@voxgig/create-sdkgen 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/bin/create-sdkgen +27 -10
  2. package/dist/create-sdkgen.d.ts +2 -0
  3. package/dist/create-sdkgen.js +51 -5
  4. package/dist/create-sdkgen.js.map +1 -1
  5. package/dist/project/standard/CreateRoot.d.ts +2 -0
  6. package/dist/project/standard/CreateRoot.js +50 -0
  7. package/dist/project/standard/CreateRoot.js.map +1 -0
  8. package/dist/project/standard/ModelSdk.js +6 -1
  9. package/dist/project/standard/ModelSdk.js.map +1 -1
  10. package/dist/tsconfig.tsbuildinfo +1 -1
  11. package/package.json +10 -10
  12. package/project/standard/.sdk/model/api/api-info.jsonic +5 -0
  13. package/project/standard/.sdk/model/config.jsonic +3 -1
  14. package/project/standard/.sdk/model/{api/api-entity-index.jsonic → entity/entity-index.jsonic} +1 -0
  15. package/project/standard/.sdk/model/guide/guide.jsonic +8 -0
  16. package/project/standard/.sdk/model/sdk.fragment.jsonic +6 -10
  17. package/project/standard/.sdk/package.json +5 -7
  18. package/project/standard/.sdk/src/BuildSDK.ts +113 -0
  19. package/project/standard/.sdk/src/Root.ts +19 -7
  20. package/project/standard/.sdk/src/Top.ts +6 -2
  21. package/project/standard/.sdk/test/primary/primary-test-index.jsonic +23 -0
  22. package/project/standard/.sdk/test/struct/merge.jsonic +102 -4
  23. package/project/standard/.sdk/test/struct/minor.jsonic +106 -38
  24. package/project/standard/.sdk/test/struct/select.jsonic +86 -5
  25. package/project/standard/.sdk/test/struct/test.json +16635 -0
  26. package/project/standard/.sdk/test/struct/test.jsonic +25 -0
  27. package/project/standard/.sdk/test/struct/transform.jsonic +100 -1
  28. package/project/standard/.sdk/test/struct/validate.jsonic +82 -45
  29. package/project/standard/.sdk/test/struct/walk.jsonic +57 -6
  30. package/project/standard/.sdk/test/test.json +5568 -2838
  31. package/project/standard/.sdk/test/test.jsonic +2 -43
  32. package/src/create-sdkgen.ts +74 -7
  33. package/src/project/standard/{Root.ts → CreateRoot.ts} +11 -6
  34. package/src/project/standard/ModelSdk.ts +6 -1
  35. package/dist/project/standard/Root.d.ts +0 -2
  36. package/dist/project/standard/Root.js +0 -79
  37. package/dist/project/standard/Root.js.map +0 -1
  38. package/dist/standard/ModelSdk.d.ts +0 -2
  39. package/dist/standard/ModelSdk.js +0 -19
  40. package/dist/standard/ModelSdk.js.map +0 -1
  41. package/dist/standard/Root.d.ts +0 -2
  42. package/dist/standard/Root.js +0 -77
  43. package/dist/standard/Root.js.map +0 -1
  44. package/dist/utility.d.ts +0 -2
  45. package/dist/utility.js +0 -5
  46. package/dist/utility.js.map +0 -1
  47. package/project/standard/.sdk/model/api/api-def.jsonic +0 -5
  48. package/project/standard/.sdk/model/guide.jsonic +0 -5
  49. package/project/standard/.sdk/model/target/target-index.jsonic~ +0 -4
  50. /package/project/standard/.sdk/test/primary/{contextify.jsonic → context.jsonic} +0 -0
@@ -0,0 +1,25 @@
1
+
2
+ struct: &: {
3
+ name: .$KEY
4
+ set: []
5
+ }
6
+
7
+ struct: minor: @"minor.jsonic"
8
+ struct: getpath: @"getpath.jsonic"
9
+ struct: inject: @"inject.jsonic"
10
+ struct: merge: @"merge.jsonic"
11
+ struct: transform: @"transform.jsonic"
12
+ struct: walk: @"walk.jsonic"
13
+ struct: validate: @"validate.jsonic"
14
+ struct: select: @"select.jsonic"
15
+
16
+ primary: check: {
17
+ DEF: {
18
+ client:a:test:options:foo:1
19
+ }
20
+ basic: set: [
21
+ { ctx:meta:bar:BAR0, out:zed:ZED_BAR0 }
22
+ { ctx:meta:bar:BAR1, client:a, out:zed:ZED1_BAR1 }
23
+ ]
24
+ }
25
+
@@ -284,13 +284,32 @@ each: {
284
284
  out: [{x0:y0:0},{x0:y0:1}]
285
285
  }
286
286
 
287
-
287
+
288
+ {
289
+ in: data: ['a','b','c']
290
+ in: spec: ['`$EACH`','','`$COPY`']
291
+ out: ['a','b','c']
292
+ }
293
+
294
+ {
295
+ in: data: ['a','b','c']
296
+ in: spec: ['`$EACH`','',['`$FORMAT`','upper','`$COPY`']]
297
+ out: ['A','B','C']
298
+ }
288
299
  ]
289
300
  }
290
301
 
291
302
 
292
303
  pack: {
293
304
  set: [
305
+ { in: { data: {x:[{y:0,k:'K0'},{y:1,k:'K1'}]},
306
+ spec: {z:{'`$PACK`':['x',{'`$KEY`':'k', y:'`.y`',p:'P0'}]}} },
307
+ out: {z:{K0:{y:0,p:'P0'},K1:{y:1,p:'P0'}}} }
308
+
309
+ { in: { data: {x:[{y:0,k:'K0'},{y:1,k:'K1'}]},
310
+ spec: {z:{'`$PACK`':['x',{'`$KEY`':'k', '`$VAL`':{y:'`.y`',p:'P1'}}]}} },
311
+ out: {z:{K0:{y:0,p:'P1'},K1:{y:1,p:'P1'}}} }
312
+
294
313
  { in: { data: {x:[{y:0,k:'K0'},{y:1,k:'K1'}]},
295
314
  spec: {z:{'`$PACK`':['x',{'`$KEY`':'k', y:'`$COPY`',q:'Q0'}]}} },
296
315
  out: {z:{K0:{y:0,q:'Q0'},K1:{y:1,q:'Q0'}}} }
@@ -325,6 +344,32 @@ pack: {
325
344
  out: {a:{b:{c:{d:{e:{K0:{y:0,q:'Q7'}}}}}}} }
326
345
 
327
346
 
347
+ { in: { data: ['a','b','c'],
348
+ spec: {'`$PACK`':['',{'`$VAL`': '`$COPY`'}]}},
349
+ out: {0:a,1:b,2:c} }
350
+
351
+ { in: { data: ['a','b','c'],
352
+ spec: {'`$PACK`':['','`$COPY`']}},
353
+ out: {0:a,1:b,2:c} }
354
+
355
+ { in: { data: ['a','b','c'],
356
+ spec: {'`$PACK`':['','X']}},
357
+ out: {0:X,1:X,2:X} }
358
+
359
+ { in: { data: ['a','b','c'],
360
+ spec: {'`$PACK`':['',{'`$KEY`':'`$COPY`', '`$VAL`': '`$COPY`'}]}},
361
+ out: {a:a,b:b,c:c} }
362
+
363
+ { in: { data: ['a','b','c'],
364
+ spec: {'`$PACK`':['',{'`$KEY`':'`$COPY`', x:'`$KEY`'}]}},
365
+ out: {a:x:a,b:x:b,c:x:c} }
366
+
367
+ { in: { data: ['a','b','c'],
368
+ spec: {'`$PACK`':['',{'`$KEY`': '`$COPY`',
369
+ '`$VAL`': ['`$FORMAT`','upper','`$COPY`'] }]}},
370
+ out: {a:A,b:B,c:C} }
371
+
372
+
328
373
  { in: { data: {x:[{y:0,k:'K0'}]},
329
374
  spec: {a:{b:{c:{d:{e:{'`$PACK`':['x',{'`$KEY`':'k', y:'`$COPY`',q:'Q8'}]}}}}}} },
330
375
  out: {a:{b:{c:{d:{e:{K0:{y:0,q:'Q8'}}}}}}} }
@@ -336,6 +381,8 @@ pack: {
336
381
  { in: { data: {v100:11,x100:[{y:0,k:'K0'},{y:1,k:'K1'}]},
337
382
  spec: {a:{b:{'`$PACK`':['x100',{'`$KEY`':'k', y:'`.y`',p:'`...v100`'}]}}} },
338
383
  out: {a:{b:{K0:{y:0,p:11}, K1:{y:1,p:11}}}} }
384
+
385
+
339
386
 
340
387
  ]
341
388
  }
@@ -451,3 +498,55 @@ ref: {
451
498
 
452
499
  ]
453
500
  }
501
+
502
+
503
+ format: {
504
+ set: [
505
+ { in: { data: null, spec:['`$FORMAT`','upper',a] } out: A }
506
+ { in: { data: null, spec:x:['`$FORMAT`','upper',b] } out: x:B }
507
+ { in: { data: null, spec:x:[['`$FORMAT`','upper',1]] } out: x:['1'] }
508
+ { in: { data: null, spec:x:y:['`$FORMAT`','upper',true] } out: x:y:TRUE }
509
+ { in: { data: null, spec:x:y:[[['`$FORMAT`','upper',null]]] } out: x:y:[['NULL']] }
510
+ { in: { data: null, spec:['`$FORMAT`','upper',[]] } out: [] }
511
+ { in: { data: null, spec:['`$FORMAT`','upper',{}] } out: {} }
512
+ { in: { data: null, spec:['`$FORMAT`','upper',[c]] } out: [C] }
513
+ { in: { data: null, spec:['`$FORMAT`','upper',{c:d}] } out: {c:D} }
514
+ { in: { data: null, spec:['`$FORMAT`','upper',[e,[f]]] } out: [E,[F]] }
515
+ { in: { data: null, spec:['`$FORMAT`','upper',{g:h,i:j:k}] } out: {g:H,i:j:K} }
516
+
517
+ { in: { data: null, spec:['`$FORMAT`','not-a-format',a] }
518
+ err: '$FORMAT: unknown format: not-a-format.' }
519
+
520
+ { in: { data: null, spec:['`$FORMAT`','identity',1] } out: 1 }
521
+ { in: { data: null, spec:['`$FORMAT`','identity',[1]] } out: [1] }
522
+ { in: { data: null, spec:['`$FORMAT`','identity',{x:1}] } out: {x:1} }
523
+
524
+ { in: { data: null, spec:['`$FORMAT`','lower',A] } out: a }
525
+ { in: { data: null, spec:['`$FORMAT`','string',1.2] } out: '1.2' }
526
+ { in: { data: null, spec:['`$FORMAT`','number','3.4'] } out: 3.4 }
527
+ { in: { data: null, spec:['`$FORMAT`','integer',[1,2.3,'4','5.6']] } out: [1,2,4,5] }
528
+ { in: { data: null, spec:['`$FORMAT`','number',{a:1,b:2.3,c:'4',d:'5.6'}] }
529
+ out: {a:1 b:2.3 c:4 d:5.6} }
530
+
531
+ { in: { data: null, spec:['`$FORMAT`','concat',[a,b]] } out: ab }
532
+ { in: { data: null, spec:['`$FORMAT`','concat',[c,1,d,null,false,{},[]]] }
533
+ out: c1dnullfalse }
534
+ ]
535
+ }
536
+
537
+
538
+ apply: {
539
+ set: [
540
+ { in: { data: {}, spec:['`$APPLY`','not-a-function','ignored'] }
541
+ err: '$APPLY: invalid argument: '+
542
+ 'not-a-function (string at position 1) is not of type: function.' }
543
+
544
+ { in: { data: {}, spec:{'`$APPLY`':1} }
545
+ err: '$APPLY: invalid placement as key, expected: value.' }
546
+
547
+ { in: { data: {}, spec:{x:'`$APPLY`'} }
548
+ err: '$APPLY: invalid placement in parent map, expected: list.' }
549
+
550
+ ]
551
+
552
+ }
@@ -11,15 +11,29 @@ basic: {
11
11
 
12
12
  { in: { data: a, spec: '`$STRING`' }, out: a }
13
13
  { in: { data: 1, spec: '`$STRING`' }, out: 1,
14
- err: 'Invalid data: Expected string, but found number: 1.' }
15
-
14
+ err: 'Expected string, but found integer: 1.' }
15
+
16
+ { in: { data: 1001, spec: '`$NUMBER`' }, out: 1001 }
17
+ { in: { data: 1002, spec: '`$INTEGER`' }, out: 1002 }
18
+ { in: { data: 1003.3, spec: '`$DECIMAL`' }, out: 1003.3 }
19
+ { in: { data: true, spec: '`$BOOLEAN`' }, out: true }
20
+ { in: { data: {}, spec: '`$MAP`' }, out: {} }
21
+ { in: { data: [], spec: '`$LIST`' }, out: [] }
22
+ { in: { data: null, spec: '`$NULL`' }, out: null }
23
+ { in: { data: {}, spec: {n0:'`$NIL`'} }, out: {} }
24
+
25
+ { in: { data: 1101, spec: '`$ANY`' }, out: 1101 }
26
+ { in: { data: 'b0', spec: '`$ANY`' }, out: 'b0' }
27
+ { in: { data: {}, spec: '`$ANY`' }, out: {} }
28
+
16
29
  { in: { data: {a0:A}, spec: {a0:'`$STRING`'} }, out: {a0:A} }
17
30
 
18
31
  { in: { data: {a1:1}, spec: {a1:'`$STRING`'} }
19
- err: 'Expected field a1 to be string, but found number: 1' }
32
+ err: 'Expected field a1 to be string, but found integer: 1' }
20
33
 
21
34
  { in: { data: {a2:11,b2:'B'}, spec: {a2:'`$STRING`',b2:'`$NUMBER`'} }
22
- err: 'Expected field a2 to be string, but found number: 11. | Expected field b2 to be number, but found string: B.' }
35
+ err: 'Expected field a2 to be string, but found integer: 11. | '+
36
+ 'Expected field b2 to be number, but found string: B.' }
23
37
 
24
38
  { in: { data: {a3:2,b3:B,c3:true}, spec: {a3:'`$NUMBER`',b3:'`$STRING`',c3:'`$BOOLEAN`'}}
25
39
  out: {a3:2,b3:B,c3:true} }
@@ -35,22 +49,22 @@ basic: {
35
49
  out: {a:5,b:D} }
36
50
 
37
51
  { in: { data: {a:6,b:2}, spec: {a:'`$NUMBER`',b:C}}
38
- err: 'Expected field b to be string, but found number: 2' }
52
+ err: 'Expected field b to be string, but found integer: 2' }
39
53
 
40
54
 
41
- { in: { data: {x1:{a:1}}, spec: {x1:'`$OBJECT`'}}
55
+ { in: { data: {x1:{a:1}}, spec: {x1:'`$MAP`'}}
42
56
  out: {x1:{a:1}} }
43
57
 
44
- { in: { data: {x2:{}}, spec: {x2:'`$OBJECT`'}}
58
+ { in: { data: {x2:{}}, spec: {x2:'`$MAP`'}}
45
59
  out: {x2:{}} }
46
60
 
47
- { in: { data: {a:[],b:{}}, spec: {a:'`$ARRAY`',b:'`$OBJECT`'}}
61
+ { in: { data: {a:[],b:{}}, spec: {a:'`$LIST`',b:'`$MAP`'}}
48
62
  out: {a:[],b:{}} }
49
63
 
50
- { in: { data: {a:[11,22],b:{c:33,d:44}}, spec: {a:'`$ARRAY`',b:'`$OBJECT`'}}
64
+ { in: { data: {a:[11,22],b:{c:33,d:44}}, spec: {a:'`$LIST`',b:'`$MAP`'}}
51
65
  out: {a:[11,22],b:{c:33,d:44}} }
52
66
 
53
- { in: { data: {a:[[55],{c:66}],b:{d:[77],e:{f:88}}}, spec: {a:'`$ARRAY`',b:'`$OBJECT`'}}
67
+ { in: { data: {a:[[55],{c:66}],b:{d:[77],e:{f:88}}}, spec: {a:'`$LIST`',b:'`$MAP`'}}
54
68
  out: {a:[[55],{c:66}],b:{d:[77],e:{f:88}}} }
55
69
 
56
70
  { in: { data: {}, spec: {b0:'`$BOOLEAN`'} }
@@ -66,11 +80,34 @@ basic: {
66
80
 
67
81
  { in: { data: {a:{x:12,y:22}}, spec: {a:{x:0,'`$OPEN`':true}} }, out: {a:{x:12,y:22}} }
68
82
 
69
- { in: { data: {a1:{}}, spec: {a1:[]} },
70
- err:'Expected field a1 to be array, but found object: {}.' }
83
+ { in: { data: {c1:{}}, spec: {c1:[]} },
84
+ err:'Expected field c1 to be list, but found map: {}.' }
85
+
86
+ { in: { data: {c2:[]}, spec: {c2:{}} },
87
+ err:'Expected field c2 to be map, but found list: [].' }
88
+
89
+ { in: { data: '', spec: '`$STRING`' },
90
+ err:'Empty string at <root>' }
91
+
92
+ { in: { data: {s0:''}, spec: {s0:'`$STRING`'} },
93
+ err:'Empty string at s0' }
94
+
95
+ { in: { data: {s1:''}, spec: {s1:['`$ONE`','`$STRING`','']} },
96
+ out: {s1:''} }
97
+
98
+ { in: { data: z0, spec: '`$NUMBER`' } err: 'Expected number, but found string: z0.' }
99
+ { in: { data: z1, spec: '`$INTEGER`' } err: 'Expected integer, but found string: z1.' }
100
+ { in: { data: z2, spec: '`$DECIMAL`' } err: 'Expected decimal, but found string: z2.' }
101
+ { in: { data: z3, spec: '`$BOOLEAN`' } err: 'Expected boolean, but found string: z3.' }
102
+ { in: { data: z4, spec: '`$MAP`' } err: 'Expected map, but found string: z4.' }
103
+ { in: { data: z5, spec: '`$LIST`' } err: 'Expected list, but found string: z5.' }
104
+ { in: { data: z6, spec: '`$NULL`' } err: 'Expected null, but found string: z6.' }
105
+ { in: { data: {n1:z7}, spec: {n1:'`$NIL`'} }
106
+ err: 'Expected field n1 to be nil, but found string: z7.' }
107
+
108
+ { in: { data: 4.4, spec: '`$INTEGER`' }, err: 'Expected integer, but found decimal: 4.4.' }
109
+ { in: { data: 5, spec: '`$DECIMAL`' }, err: 'Expected decimal, but found integer: 5.' }
71
110
 
72
- { in: { data: {a2:[]}, spec: {a2:{}} },
73
- err:'Expected field a2 to be object, but found array: [].' }
74
111
  ]
75
112
  }
76
113
 
@@ -84,7 +121,7 @@ child: {
84
121
  out: {q:{}} }
85
122
 
86
123
  { in: { data: {q:{a:{x:X}}}, spec: {q:{'`$CHILD`':{x:'`$NUMBER`'}}} },
87
- err: 'Invalid data: Expected field q.a.x to be number, but found string: X' }
124
+ err: 'Expected field q.a.x to be number, but found string: X' }
88
125
 
89
126
  { in: { data: {q:{a:{x:1,y:'Y1'},b:{x:2,y:'Y2'}}},
90
127
  spec: {q:{'`$CHILD`':{x:'`$NUMBER`','`$OPEN`':true}}} },
@@ -109,20 +146,20 @@ child: {
109
146
  { in: { data: {q:[]}, spec: {q:['`$CHILD`','`$BOOLEAN`']} },
110
147
  out: {q:[]} }
111
148
 
112
- { in: { data: {q:a25}, spec: {q:['`$CHILD`','`$OBJECT`']} },
113
- err: 'Expected field q to be array, but found string: a25' }
149
+ { in: { data: {q:a25}, spec: {q:['`$CHILD`','`$MAP`']} },
150
+ err: 'Expected field q to be list, but found string: a25' }
114
151
 
115
152
  # Child template is a default value defining type
116
153
  { in: { data:{a40:{x0:2}}, spec: {a40:{'`$CHILD`':1}}}, out:{a40:{x0:2}} }
117
154
  { in: { data:{a41:{x0:3,x1:4}}, spec: {a41:{'`$CHILD`':1}}}, out:{a41:{x0:3,x1:4}} }
118
155
  { in: { data:{a411:{x2:'X'}}, spec: {a411:{'`$CHILD`':1}}}
119
- err: 'Expected field a411.x2 to be number, but found string: X'}
156
+ err: 'Expected field a411.x2 to be integer, but found string: X'}
120
157
 
121
158
  { in: { data:{a42:{}}, spec: {a42:{'`$CHILD`':1}}}, out:{a42:{}} }
122
159
  { in: { data:{}, spec: {a43:{'`$CHILD`':1}}}, out:{a43:{}} }
123
160
 
124
161
  { in: { data:{a44:1}, spec: {a44:{'`$CHILD`':{y:1}}}}
125
- err: 'Expected field a44 to be object, but found number: 1' }
162
+ err: 'Expected field a44 to be map, but found integer: 1' }
126
163
 
127
164
  { in: { data:{a50:[2]}, spec: {a50:['`$CHILD`',1]}}, out:{a50:[2]} }
128
165
  { in: { data:{a51:[3,4]}, spec: {a51:['`$CHILD`',1]}}, out:{a51:[3,4]} }
@@ -157,20 +194,20 @@ one: {
157
194
  { in: { data: {x0:true}, spec: {x0:['`$ONE`','`$STRING`','`$NUMBER`']}},
158
195
  err: 'Expected field x0 to be one of string, number, but found boolean: true.' }
159
196
 
160
- { in: { data: {x1:{a:1}}, spec: ['`$ONE`',{x1:'`$ARRAY`'}, {x1:'`$OBJECT`'}]},
197
+ { in: { data: {x1:{a:1}}, spec: ['`$ONE`',{x1:'`$LIST`'}, {x1:'`$MAP`'}]},
161
198
  out: {x1:{a:1}} }
162
199
 
163
200
  { in: { data: {x2:{a:1}}, spec: ['`$ONE`',{x2:{a:'`$STRING`'}}, {x2:{a:'`$NUMBER`'}}]},
164
201
  out: {x2:{a:1}} }
165
202
 
166
- { in: { data: {a:{}}, spec: {a:['`$ONE`','`$OBJECT`','`$ARRAY`']} }, out: {a:{}} }
167
- { in: { data: {a:[]}, spec: {a:['`$ONE`','`$OBJECT`','`$ARRAY`']} }, out: {a:[]} }
203
+ { in: { data: {a:{}}, spec: {a:['`$ONE`','`$MAP`','`$LIST`']} }, out: {a:{}} }
204
+ { in: { data: {a:[]}, spec: {a:['`$ONE`','`$MAP`','`$LIST`']} }, out: {a:[]} }
168
205
 
169
- { in: { data: {a:1}, spec: {a:['`$ONE`','`$OBJECT`','`$ARRAY`']} },
170
- err: 'Expected field a to be one of object, array, but found number: 1.' }
206
+ { in: { data: {a:1}, spec: {a:['`$ONE`','`$MAP`','`$LIST`']} },
207
+ err: 'Expected field a to be one of map, list, but found integer: 1.' }
171
208
 
172
- { in: { data: {}, spec: {a:['`$ONE`','`$OBJECT`','`$ARRAY`']} },
173
- err: 'Expected field a to be one of object, array, but found no value.' }
209
+ { in: { data: {}, spec: {a:['`$ONE`','`$MAP`','`$LIST`']} },
210
+ err: 'Expected field a to be one of map, list, but found no value.' }
174
211
  ]
175
212
  }
176
213
 
@@ -191,34 +228,34 @@ exact: {
191
228
  { in: { data: [{x:2}], spec: ['`$EXACT`',[{x:2}] ] }, out: [{x:2}] }
192
229
 
193
230
  { in: { data: 21, spec: ['`$EXACT`',22] },
194
- err:'Expected value exactly equal to 22, but found number: 21.' }
231
+ err:'Expected value exactly equal to 22, but found integer: 21.' }
195
232
 
196
233
  { in: { data: 23, spec: ['`$EXACT`','a',false,24] },
197
- err:'Expected value exactly equal to one of a, false, 24, but found number: 23.' }
234
+ err:'Expected value exactly equal to one of a, false, 24, but found integer: 23.' }
198
235
 
199
236
  { in: { data: 25, spec: ['`$EXACT`',{},[]] },
200
- err:'Expected value exactly equal to one of {}, [], but found number: 25.' }
237
+ err:'Expected value exactly equal to one of {}, [], but found integer: 25.' }
201
238
 
202
239
  { in: { data: 26, spec: ['`$EXACT`',{x:1},[2]] },
203
- err:'Expected value exactly equal to one of {x:1}, [2], but found number: 26.' }
240
+ err:'Expected value exactly equal to one of {x:1}, [2], but found integer: 26.' }
204
241
 
205
242
  { in: { data: 27, spec: ['`$EXACT`',{x:[3]},[{y:4}]] },
206
- err:'Expected value exactly equal to one of {x:[3]}, [{y:4}], but found number: 27.' }
243
+ err:'Expected value exactly equal to one of {x:[3]}, [{y:4}], but found integer: 27.' }
207
244
 
208
245
  { in: { data: 28, spec: ['`$EXACT`',{x:{y:{z:[]}}}] },
209
- err:'Expected value exactly equal to {x:{y:{z:[]}}}, but found number: 28.' }
246
+ err:'Expected value exactly equal to {x:{y:{z:[]}}}, but found integer: 28.' }
210
247
 
211
248
  { in: { data: [31,32], spec: ['`$EXACT`',[33,34]] },
212
- err:'Expected value exactly equal to [33,34], but found array: [31,32].' }
249
+ err:'Expected value exactly equal to [33,34], but found list: [31,32].' }
213
250
 
214
251
  { in: { data: {x:111}, spec: ['`$EXACT`',{x:222}] },
215
- err:'Expected value exactly equal to {x:222}, but found object: {x:111}.' }
252
+ err:'Expected value exactly equal to {x:222}, but found map: {x:111}.' }
216
253
 
217
254
  { in: { data: {b:35,a:36}, spec: ['`$EXACT`',{b:37,a:36}] },
218
- err:'Expected value exactly equal to {a:36,b:37}, but found object: {a:36,b:35}.' }
255
+ err:'Expected value exactly equal to {a:36,b:37}, but found map: {a:36,b:35}.' }
219
256
 
220
257
  { in: { data: {x0:{b:35,a:36}}, spec: {x0:['`$EXACT`',{b:37,a:36}]} },
221
- err:'Expected field x0 to be exactly equal to {a:36,b:37}, but found object: {a:36,b:35}.' }
258
+ err:'Expected field x0 to be exactly equal to {a:36,b:37}, but found map: {a:36,b:35}.' }
222
259
 
223
260
  ]
224
261
  }
@@ -229,20 +266,20 @@ invalid: set: [
229
266
  err: 'Expected string, but found no value.' }
230
267
 
231
268
  { in: { data:{b0:1,a0:'a'}, spec: {a0:11,b0:'bb'}},
232
- err: 'Expected field a0 to be number, but found string: a. | '+
233
- 'Expected field b0 to be string, but found number: 1.' }
269
+ err: 'Expected field a0 to be integer, but found string: a. | '+
270
+ 'Expected field b0 to be string, but found integer: 1.' }
234
271
 
235
272
  { in: { data: {a0:2}, spec: {a0:['`$EXACT`', 1]} },
236
- err: 'Invalid data: Expected field a0 to be exactly equal to 1, but found number: 2.' }
273
+ err: 'Expected field a0 to be exactly equal to 1, but found integer: 2.' }
237
274
 
238
275
  { in: { data: {}, spec:{a1:['`$EXACT`', 1] } },
239
- err: 'Invalid data: Expected field a1 to be exactly equal to 1, but found no value.' }
276
+ err: 'Expected field a1 to be exactly equal to 1, but found no value.' }
240
277
 
241
278
  { in: { data: null, spec:{a2:['`$EXACT`', 1] } },
242
- err: 'Invalid data: Expected field a2 to be exactly equal to 1, but found no value.' }
279
+ err: 'Expected field a2 to be exactly equal to 1, but found no value.' }
243
280
 
244
281
  { in: { spec:{a3:['`$EXACT`', 1] } },
245
- err: 'Invalid data: Expected field a3 to be exactly equal to 1, but found no value.' }
282
+ err: 'Expected field a3 to be exactly equal to 1, but found no value.' }
246
283
  ]
247
284
 
248
285
 
@@ -257,16 +294,16 @@ special: set: [
257
294
 
258
295
  { in: { data: {x10:100}, spec:{x10:['`$EXACT`', 100] }, inj:meta:q0:x1:100 }, out: {x10:100}}
259
296
  { in: { data: {x11:'s11'}, spec:{x11:['`$EXACT`', 101] }, inj:meta:q0:x1:101 },
260
- err: 'Invalid data: Expected field x11 to be exactly equal to 101, but found string: s11.'}
297
+ err: 'Expected field x11 to be exactly equal to 101, but found string: s11.'}
261
298
 
262
299
  { in: { data: {x12:102}, spec:{x12:'`q0$=x1`' }, inj:meta:q0:x1:102 }, out: {x12:102} }
263
300
  { in: { data: {x13:'s13'}, spec:{x13:'`q0$=x1`' }, inj:meta:q0:x1:103 },
264
- err: 'Invalid data: Expected field x13 to be exactly equal to 103, but found string: s13.'}
301
+ err: 'Expected field x13 to be exactly equal to 103, but found string: s13.'}
265
302
 
266
303
  { in: { data: {x14:104}, spec:{x14:'`q0$~x1`' }, inj:meta:q0:x1:104 }, out: {x14:104} }
267
304
  { in: { data: {x15:204}, spec:{x15:'`q0$~x1`' }, inj:meta:q0:x1:104 }, out: {x15:204} }
268
305
  { in: { data: {x16:'s16'}, spec:{x16:'`q0$~x1`' }, inj:meta:q0:x1:104 }
269
- err: 'Invalid data: Expected field x16 to be number, but found string: s16.' }
306
+ err: 'Expected field x16 to be integer, but found string: s16.' }
270
307
 
271
308
  { in: { data: 2000, spec:2000, inj:meta:'`$EXACT`':true }, out: 2000 }
272
309
 
@@ -1,12 +1,30 @@
1
1
 
2
2
  log: {
3
3
  in: { a: { c: 2, b: 1 } }
4
- out: [
5
- 'k=b, v=1, p={b:1,c:2}, t=a.b',
6
- 'k=c, v=2, p={b:1,c:2}, t=a.c',
7
- 'k=a, v={b:1,c:2}, p={a:{b:1,c:2}}, t=a',
8
- 'k=, v={a:{b:1,c:2}}, p=, t=<root>'
9
- ]
4
+ out: {
5
+ before: [
6
+ 'k=, v={a:{b:1,c:2}}, p=, t=<root>'
7
+ 'k=a, v={b:1,c:2}, p={a:{b:1,c:2}}, t=a',
8
+ 'k=b, v=1, p={b:1,c:2}, t=a.b',
9
+ 'k=c, v=2, p={b:1,c:2}, t=a.c',
10
+ ]
11
+ after: [
12
+ 'k=b, v=1, p={b:1,c:2}, t=a.b',
13
+ 'k=c, v=2, p={b:1,c:2}, t=a.c',
14
+ 'k=a, v={b:1,c:2}, p={a:{b:1,c:2}}, t=a',
15
+ 'k=, v={a:{b:1,c:2}}, p=, t=<root>'
16
+ ]
17
+ both: [
18
+ 'k=, v={a:{b:1,c:2}}, p=, t=<root>',
19
+ 'k=a, v={b:1,c:2}, p={a:{b:1,c:2}}, t=a',
20
+ 'k=b, v=1, p={b:1,c:2}, t=a.b',
21
+ 'k=b, v=1, p={b:1,c:2}, t=a.b',
22
+ 'k=c, v=2, p={b:1,c:2}, t=a.c',
23
+ 'k=c, v=2, p={b:1,c:2}, t=a.c',
24
+ 'k=a, v={b:1,c:2}, p={a:{b:1,c:2}}, t=a',
25
+ 'k=, v={a:{b:1,c:2}}, p=, t=<root>'
26
+ ]
27
+ }
10
28
  }
11
29
 
12
30
 
@@ -55,3 +73,36 @@ basic: {
55
73
  }
56
74
 
57
75
 
76
+ depth: {
77
+ set: [
78
+ { in: { src: { a:b:{c:1,d:11} } } out: { a:b:{c:1,d:11} } }
79
+ { in: { src: { a:b:{c:2,d:22} } maxdepth:-1 }, out: { a:b:{c:2,d:22} } }
80
+ { in: { src: { a:b:{c:3,d:33} } maxdepth:11 }, out: { a:b:{c:3,d:33} } }
81
+ { in: { src: { a:b:{c:4,d:44} } maxdepth:4 }, out: { a:b:{c:4,d:44} } }
82
+ { in: { src: { a:b:{c:5,d:55} } maxdepth:3 }, out: { a:b:{c:5,d:55} } }
83
+ { in: { src: { a:b:{c:6,d:66} } maxdepth:2 }, out: { a:b:{} } }
84
+ { in: { src: { a:b:{c:7,d:77} } maxdepth:1 }, out: { a:{} } }
85
+ { in: { src: { a:b:{c:8,d:88} } maxdepth:0 }, out: {} }
86
+ ]
87
+ }
88
+
89
+
90
+ copy: {
91
+ set: [
92
+ { in: {a0:0} out: {a0:0} }
93
+ { in: [1] out: [1] }
94
+ { in: {} out: {} }
95
+ { in: [] out: [] }
96
+ { in: null out: null }
97
+ { }
98
+ { in: {a1:{b1:1}} out: {a1:{b1:1}} }
99
+
100
+ { in: {a2:{b2:2},c2:{d2:{e2:22,f2:222}},g2:2222}
101
+ out: {a2:{b2:2},c2:{d2:{e2:22,f2:222}},g2:2222} }
102
+
103
+ { in: [[3],[33],[[333],[3333]]]
104
+ out: [[3],[33],[[333],[3333]]] }
105
+ ]
106
+ }
107
+
108
+