【文件属性】:
文件名称:key-path:JavaScript 对象的深层属性访问器
文件大小:10KB
文件格式:ZIP
更新时间:2021-06-08 23:25:14
JavaScript
JavaScript 对象的深层属性访问器。
最初取自
安装
$ npm install --save key-path
用法
var KeyPath = require ( 'key-path' ) ;
var kp = KeyPath . get ( [ 'identifier' , 1 , 'string with space' ] ) ;
// OR
var kp = KeyPath . get ( "identifier[1]['string with space']" ) ;
var obj = {
identifier : [
'some value' ,
{
'string with space' : 'you got me!'
}
]
}
assert kp . getValueFrom ( obj ) === 'you g
【文件预览】:
key-path-master
----.travis.yml(72B)
----index.js(10KB)
----package.json(1KB)
----.yo-rc.json(26B)
----test()
--------test.js(7KB)
----Gruntfile.js(1014B)
----.gitignore(37B)
----README.md(4KB)
----.jshintrc(227B)
----.editorconfig(188B)
----.gitattributes(12B)