deep-picker
v0.0.2
Published
pick deeply with keyMap
Downloads
9
Readme
deep-picker
pick value in json object with keyMap
usage example
var keyMap = [
'master',
{
'book': [
{'Chinese': {'Moyan': 'name'}},
'English'
]
}
]
var all = {
master: 'ace.lee',
book: {
Chinese: {
Moyan: {name: 'A buxom'},
EileenChang: 'Little reunion'
},
English: {
Shakespeare: ['Hamlet', 'Macbeth'],
Jane: 'Pride and Prejudice'
}
}
total: 100
};
var deepPicker = require('deep-picker');
//var out = {
// master: 'ace.lee',
// book: {
// Chinese: {
// Moyan: {name: 'A buxom'}
// },
// English: {
// Shakespeare: ['Hamlet', 'Macbeth'],
// Jane: 'Pride and Prejudice'
// }
// }
//};
deepPicker(keyMap, all);