1.0.1 • Published 2 years ago
nv-array-pary v1.0.1
nv-array-pary
- a slow array-tree
- for test nvlang pary data-type,
install
- npm install nv-array-pary
splitted
usage
const x = require("nv-array-pary");
example
var nd1 = x.creat("t1",{v:111})
var nd2 = x.creat("t2",{v:222})
> var nd1 = x.creat("t1",{v:111})
> var nd2 = x.creat("t2",{v:222})
> nd1.id
1
> nd2.id
2
>
> nd1.t
't1'
> nd2.t
't2'
>
> nd1._attr()
{ v: 111 }
> nd2._attr()
{ v: 222 }
>
> nd1.pr
null
> nd2.pr
null
>
> nd1.$push(nd2)
> nd1
(1) [ (0) [ v: 222 ], v: 111 ]
>
> nd2.pr
(1) [ (0) [ v: 222 ], v: 111 ]
>
> nd2.pr === nd1
true
>
> console.log(JSON.stringify(nd1._dump()))
["t1",{"v":111},[["t2",{"v":222},[]]]]
METHODS
//getter
nd.idx
nd.id
nd.pr
nd.length
nd.t
//mthd
nd.$disc
nd.$iaft
nd.$ibfr
nd.$is_rt
nd.$pop
nd.$pop_many
nd.$push
nd.$push_many
nd.$unshift
nd.$unshift_many
//user-defined-impl
nd._attr
nd._dump
nd._is_nd
APIS
{
creat_idpool: [Function: creat_idpool],
SHARED_IDPOOL: _Idpool(1) [ 1 ],
is_ary_idx: [Function: is_ary_idx],
is_ary_key: [Function: is_ary_key],
_Base: [class extends Array],
creat_without_check: [Function: creat_without_check],
creat: [Function: creat],
load_from_dump: [Function: load_from_dump]
}
LICENSE
- ISC
1.0.1
2 years ago