- SLOW named-tuple, for config using
- npm install nv-facutil-nt
const x = require("nv-facutil-nt");
> x
[Function: creat] {
rename: Symbol(rename),
swapk: Symbol(swapk),
swapv: Symbol(swapv),
foreach: Symbol(foreach),
map: Symbol(map),
filter: Symbol(filter),
to_ary: Symbol(to_ary),
to_st: Symbol(to_st),
to_mp: Symbol(to_mp),
to_dict: Symbol(to_dict)
}
> var nt = x({a:100,b:200})
> nt
Proxy [
NamedTuple { ks: [ 'a', 'b' ], vs: [ 100, 200 ] },
{
get: [Function: get],
set: [Function: set],
deleteProperty: [Function: deleteProperty]
}
]
> nt[x.map]((v,k,i,self)=>[k+i,v])
Proxy [
NamedTuple { ks: [ 'a0', 'b1' ], vs: [ 100, 200 ] },
{
get: [Function: get],
set: [Function: set],
deleteProperty: [Function: deleteProperty]
}
]
>