flat-to-nested-js:将层次结构从平面表示转换为嵌套表示

时间:2021-05-08 16:03:41
【文件属性】:
文件名称:flat-to-nested-js:将层次结构从平面表示转换为嵌套表示
文件大小:51KB
文件格式:ZIP
更新时间:2021-05-08 16:03:41
JavaScript 平面嵌套 将层次结构从平面表示转换为嵌套表示。 例子 var FlatToNested , flatToNested , flat ; FlatToNested = require ( 'flat-to-nested' ) ; flatToNested = new FlatToNested ( /* can take a config object to use other property names */ ) ; flat = [ { id : 111 , parent : 11 } , { id : 11 , parent : 1 } , { id : 12 , parent : 1 } , { id : 1 } ] ; var nested = flatToNested . convert ( flat ) ; console . log ( nested ) ; // {
【文件预览】:
flat-to-nested-js-master
----.jshintrc(414B)
----.gitignore(107B)
----package.json(1KB)
----package-lock.json(161KB)
----.eslintrc.yaml(87B)
----.travis.yml(113B)
----LICENSE(1KB)
----index.js(2KB)
----types()
--------tslint.json(40B)
--------tsconfig.json(507B)
--------index.test.ts(616B)
--------index.d.ts(991B)
----README.md(1KB)
----test()
--------test.js(6KB)
--------mocha.opts(37B)

网友评论