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