Package Exports
- arraylist-to-tree
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (arraylist-to-tree) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
arrayList-tree
A small library that converts Array of list to tree
Installation
npm install arraylist-to-tree
Usage
const tree = require('arraylistTotree');
var list = [ { id: 1, parentInt: 0 }, { id: 2, parentInt: 1 }, { id: 3, parentInt: 1 }, { id: 4, parentInt: 2 }, { id: 5, parentInt: 2 }];
Result
[{ "id": 1, "parentInt": 0, "children": [ { "id": 2, "parentInt": 1, "children": [ { "id": 4, "parentInt": 2 }, { "id": 5, "parentInt": 2 } ] }] }]
Tests
npm test
Keywords
nodejs
typescript
javascript
list-to-tree
arraylist
treeview
convertToTree
javascript collection to treejs
collection to treecollectionjquery
list to treejquery
collection to tree