path-to-object:将字符串“ abc”转换为对象{a

时间:2024-06-01 00:34:00
【文件属性】:

文件名称:path-to-object:将字符串“ abc”转换为对象{a

文件大小:2KB

文件格式:ZIP

更新时间:2024-06-01 00:34:00

JavaScript

到对象的路径 将字符串'abc'转换为对象{a: {b: {c: {}}}} 安装 npm install path-to-object 用法示例 var pathToObject = require('path-to-object'); pathToObject('a.b.c.d'); // {a: {b: {c: {d: {}}}} // Passing second param will set last field's value pathToObject('a.b.c', true); // {a: {b: {c: true}}} // Helper contains method to get or set value by string path var myObj = { a: { b: 5 } }; pathToObject.value(


【文件预览】:
path-to-object-master
----index.js(969B)
----package.json(513B)
----.gitignore(5B)
----README.md(604B)

网友评论