|
Download admin-bro/src/utils/flat/select-params.doc.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 504 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/admin-bro/src/utils/flat/select-params.doc.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/admin-bro/src/utils/flat/select-params.doc.md
-
curl -L -o select-params.doc.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/admin-bro/src/utils/flat/select-params.doc.md
504 Bytes
| From all keys in `params` it selects only those passed in arguments. | |
| ### Example | |
| ```javascript | |
| import flat from '@adminjs' | |
| const params = { | |
| name: 'John', | |
| 'education.school.name': 'Harvard', | |
| 'education.school.id': 123, | |
| } | |
| flat.selectParams(params, 'education.school') | |
| // results to { | |
| // 'education.school.name': 'Harvard', | |
| // 'education.school.id': 123, | |
| // } | |
| flat.selectParams(params, 'education.school.id', 'name') | |
| // results to { | |
| // 'name': 'John', | |
| // 'education.school.id': 123, | |
| // } |