adminjs
Version:
Admin panel for apps written in node.js
25 lines (19 loc) • 504 B
Markdown
From all keys in `params` it selects only those passed in arguments.
```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,
// }