|
Download admin-bro/src/utils/flat/get.doc.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 587 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/admin-bro/src/utils/flat/get.doc.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/admin-bro/src/utils/flat/get.doc.md
-
curl -L -o get.doc.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/admin-bro/src/utils/flat/get.doc.md
587 Bytes
Returns sub-property from the flatten params. When the property path is not given function returns an entire unflatten object.
Example
import flat from '@adminjs'
const params = {
name: 'John',
'education.school.name': 'Harvard',
'education.school.id': 123,
}
const data = flat.get(params, 'education.school')
// results to {
// name: 'Harvard',
// id: 321,
// }
// value is undefined
const data = flat.get(params)
// results to {
// name: 'John',
// education: {
// school: {
// name: 'Harvard',
// id: 321,
// }
// }
// }