0.0.9 • Published 3 years ago

arbre-tree v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Tree Structure library that provide Apis like Array.

Installing

Using npm:

npm install arbre-tree

Using yarn:

yarn add arbre-tree

Example

import ArbreTree from 'arbre-tree'

const treeData = [
    {
        id: 1,
        pid: -1,
        children: [
            {
                id: 2,
                pid: 1
            }
        ]
    }
]

const tree = new ArbreTree(treeData)

const treeArray = [
    { id: 1, pid: -1 },
    { id: 2, pid: 1 }
]

const treeFromArray = ArbreTree.from(treeArray)

tree.forEach((node) => {})

tree.forEach((node) => node.id)

tree.filter((node) => node.id > 0)

tree.find((node) => node.id === 1)
0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago