- nv-path-inode is very simple util to sort and fullfill relative-paths of unique-nodes
- npm install nv-path-inode
const {fullfill,creat_tree} = require('nv-path-inode')
var pls = [
[3,4,5],
[1,2,3],
[3,6,7],
[7,8]
]
> fullfill(pls)
[
[ 1 ],
[ 1, 2 ],
[ 1, 2, 3 ],
[ 1, 2, 3, 4 ],
[ 1, 2, 3, 4, 5 ],
[ 1, 2, 3, 6 ],
[ 1, 2, 3, 6, 7 ],
[ 1, 2, 3, 6, 7, 8 ]
]
>
var t = creat_tree(pls)
> t.$sdfs_repr(r=>" ".repeat(r.$depth())+r.v)
1
2
3
4
5
6
7
8
- nvpls.fullfill(pls)
- nvpls.creat_tree(pls)
- ISC