【文件属性】:
文件名称:object-leaves
文件大小:6KB
文件格式:ZIP
更新时间:2021-05-08 09:28:34
JavaScript
对象叶
枚举对象的叶子。
安装
$ npm install --save object-leaves
用法
'use strict' ;
var objectLeaves = require ( 'object-leaves' ) ;
console . log ( objectLeaves ( {
foo : 'bar' ,
baz : 'boom' ,
one : {
two : {
three : {
four : {
five : 'six'
}
}
}
}
} ) ) ;
输出:
[ { key: 'foo', value: 'bar', path: [ 'foo' ] },
{ key: 'baz', value: 'boom', path: [ 'baz' ]
【文件预览】:
object-leaves-master
----.eslintrc(264B)
----.gitattributes(12B)
----lib()
--------index.js(888B)
----.travis.yml(57B)
----gulpfile.js(1KB)
----LICENSE(1KB)
----test()
--------index.js(3KB)
----README.md(2KB)
----.editorconfig(171B)
----.gitignore(22B)
----package.json(890B)