walking
walk through the object
遍历对象
Installation
$ npm install walking
Example
var walking = ; const obj = a: c: 1 'd' undefined b: e: f: 'g' 1 h:1 i:2 var walk = ; //the root objectwalknext //==> {a: {c: [1, 'd', undefined]}, b: [{e: {f: ['g']}}, [1, {h:1}, {i:2}]]} //search deeperwalknext // ==> {c: [1, 'd', undefined]}walknext // ==> [1, 'd', undefined]walknext // ==> 1
API
walking(object)
get a generator which yields every piece of an object or array
遍历object对象返回生成器
walk.next(true)
skip the last returnd value if it is a object
License
MIT