nv-json-buf-serde-sdesc
v1.0.6
Published
nv-json-buf-serde-sdesc ======================= - creat many buf-pos-description from a json - this pkg is for generate shape-code , dont include it in your pkg - refer to nv-json-buf-serde-info AND nv-cli-json2cls - nvlang has a dsl-mode called jbuffer-o
Downloads
1
Readme
nv-json-buf-serde-sdesc
- creat many buf-pos-description from a json
- this pkg is for generate shape-code , dont include it in your pkg
- refer to nv-json-buf-serde-info AND nv-cli-json2cls
- nvlang has a dsl-mode called jbuffer-only, it only support fixed-shape-json, this is for test that, normally USELESS
install
- npm install nv-json-buf-serde-sdesc
usage
const creat = require("nv-json-buf-serde-sdesc");
example
var j = {
a: [null,[true,false],123.456,"ssss",{},[]],
d: {
"n":null,
"t":true,
"f":false,
"A":[123.456,"ssss"]
}
}
var r= creat(j);
> r.order_
[
'A_12_1689946380283_5192',
'D_2_1689946380283_5239',
'A_2_1689946380283_2834',
'A_40_1689946380283_0492',
'A_16_1689946380283_5177',
'D_50_1689946380283_7533',
'D_101_1689946380283_6810'
]
>
> r.ser2nm
Map(7) {
'["A",0,12,[["L",1,5,[]],["L",6,11,[]]]]' => 'A_12_1689946380283_5192',
'["D",0,2,[]]' => 'D_2_1689946380283_5239',
'["A",0,2,[]]' => 'A_2_1689946380283_2834',
'["A",0,40,[["L",1,5,[]],"A_12_1689946380283_5192",["L",19,26,[]],["L",27,33,[]],"D_2_1689946380283_5239","A_2_1689946380283_2834"]]' => 'A_40_1689946380283_0492',
'["A",0,16,[["L",1,8,[]],["L",9,15,[]]]]' => 'A_16_1689946380283_5177',
'["D",0,50,[["K",1,4,[]],["L",5,9,[]],["K",10,13,[]],["L",14,18,[]],["K",19,22,[]],["L",23,28,[]],["K",29,32,[]],"A_16_1689946380283_5177"]]' => 'D_50_1689946380283_7533',
'["D",0,101,[["K",1,4,[]],"A_40_1689946380283_0492",["K",46,49,[]],"D_50_1689946380283_7533"]]' => 'D_101_1689946380283_6810'
}
>
> r.A_12_1689946380283_5192
Desc(4) [
'A',
0,
12,
[ Desc(4) [ 'L', 1, 5, [] ], Desc(4) [ 'L', 6, 11, [] ] ]
]
>
METHODS
APIS
LICENSE
- ISC