deep-picker

0.0.2 • Public • Published

deep-picker

Build Status Coverage Status

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);

Readme

Keywords

Package Sidebar

Install

npm i deep-picker

Weekly Downloads

7

Version

0.0.2

License

ISC

Last publish

Collaborators

  • aceleewinnie