@rljson/rljson 0.0.49 → 0.0.51
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.
- package/README.architecture.md +3 -14
- package/dist/README.architecture.md +3 -14
- package/dist/example.d.ts +0 -1
- package/dist/rljson.js +4 -32
- package/dist/src/example.ts +1 -20
- package/package.json +14 -14
package/README.architecture.md
CHANGED
|
@@ -94,12 +94,11 @@ and the table data is structured as dictionaries:
|
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
Each table follows the `RljsonTable` interface, which defines a `_data` property
|
|
97
|
-
containing the table rows
|
|
97
|
+
containing the table rows.
|
|
98
98
|
|
|
99
99
|
```json
|
|
100
100
|
{
|
|
101
101
|
"table0": {
|
|
102
|
-
"_type": "ingredients",
|
|
103
102
|
"_data": []
|
|
104
103
|
}
|
|
105
104
|
}
|
|
@@ -137,7 +136,6 @@ Rljson uses hashes to identify and reference data. Using the `hash-in-place`
|
|
|
137
136
|
const jsonWithHashes = hip({
|
|
138
137
|
a: {
|
|
139
138
|
_data: [{ a: 10 }],
|
|
140
|
-
_type: 'ingredients',
|
|
141
139
|
},
|
|
142
140
|
});
|
|
143
141
|
```
|
|
@@ -154,8 +152,7 @@ This results in:
|
|
|
154
152
|
"a": 10
|
|
155
153
|
}
|
|
156
154
|
],
|
|
157
|
-
"_hash": "FfCIOVQsrK1g5o5_G-AxP4"
|
|
158
|
-
"_type": "ingredients"
|
|
155
|
+
"_hash": "FfCIOVQsrK1g5o5_G-AxP4"
|
|
159
156
|
}
|
|
160
157
|
}
|
|
161
158
|
```
|
|
@@ -168,8 +165,7 @@ table `b` references table `a` using `aRef`:
|
|
|
168
165
|
```json
|
|
169
166
|
{
|
|
170
167
|
"b": {
|
|
171
|
-
"_data": [{ "aRef": "LeFJOCQVgToOfbUuKJQ-GO" }]
|
|
172
|
-
"_type": "ingredients"
|
|
168
|
+
"_data": [{ "aRef": "LeFJOCQVgToOfbUuKJQ-GO" }]
|
|
173
169
|
}
|
|
174
170
|
}
|
|
175
171
|
```
|
|
@@ -189,7 +185,6 @@ key-value pairs assigning values to ingredient names.
|
|
|
189
185
|
```json
|
|
190
186
|
{
|
|
191
187
|
"ingredients": {
|
|
192
|
-
"_type": "ingredients",
|
|
193
188
|
"_data": [
|
|
194
189
|
{
|
|
195
190
|
"name": "flour",
|
|
@@ -200,7 +195,6 @@ key-value pairs assigning values to ingredient names.
|
|
|
200
195
|
},
|
|
201
196
|
|
|
202
197
|
"nutritionalValues": {
|
|
203
|
-
"_type": "ingredients",
|
|
204
198
|
"_data": [
|
|
205
199
|
{
|
|
206
200
|
"energy": 364,
|
|
@@ -223,7 +217,6 @@ following `SliceIds` define a set of three slice IDs:
|
|
|
223
217
|
```json
|
|
224
218
|
{
|
|
225
219
|
"slices": {
|
|
226
|
-
"_type": "sliceIds",
|
|
227
220
|
"_data": [
|
|
228
221
|
{
|
|
229
222
|
"add": ["slice0", "slice1"],
|
|
@@ -240,7 +233,6 @@ Derived `SliceIds` can be created by modifying an existing set:
|
|
|
240
233
|
```json
|
|
241
234
|
{
|
|
242
235
|
"slices": {
|
|
243
|
-
"_type": "sliceIds",
|
|
244
236
|
"_data": [
|
|
245
237
|
{
|
|
246
238
|
"add": ["slice0", "slice1"],
|
|
@@ -264,7 +256,6 @@ Cake layers assign ingredients to slices.
|
|
|
264
256
|
```json
|
|
265
257
|
{
|
|
266
258
|
"layers": {
|
|
267
|
-
"_type": "layers",
|
|
268
259
|
"_data": [
|
|
269
260
|
{
|
|
270
261
|
"ingredientsTable": "recipes",
|
|
@@ -288,7 +279,6 @@ Each layer assigns different ingredients to slices.
|
|
|
288
279
|
```json
|
|
289
280
|
{
|
|
290
281
|
"cakes": {
|
|
291
|
-
"_type": "cakes",
|
|
292
282
|
"_data": [
|
|
293
283
|
{
|
|
294
284
|
"sliceIdsTable": "slices",
|
|
@@ -314,7 +304,6 @@ such as cakes, layers, or ingredients:
|
|
|
314
304
|
```json
|
|
315
305
|
{
|
|
316
306
|
"buffets": {
|
|
317
|
-
"_type": "buffets",
|
|
318
307
|
"_data": [
|
|
319
308
|
{
|
|
320
309
|
"items": [
|
|
@@ -94,12 +94,11 @@ and the table data is structured as dictionaries:
|
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
Each table follows the `RljsonTable` interface, which defines a `_data` property
|
|
97
|
-
containing the table rows
|
|
97
|
+
containing the table rows.
|
|
98
98
|
|
|
99
99
|
```json
|
|
100
100
|
{
|
|
101
101
|
"table0": {
|
|
102
|
-
"_type": "ingredients",
|
|
103
102
|
"_data": []
|
|
104
103
|
}
|
|
105
104
|
}
|
|
@@ -137,7 +136,6 @@ Rljson uses hashes to identify and reference data. Using the `hash-in-place`
|
|
|
137
136
|
const jsonWithHashes = hip({
|
|
138
137
|
a: {
|
|
139
138
|
_data: [{ a: 10 }],
|
|
140
|
-
_type: 'ingredients',
|
|
141
139
|
},
|
|
142
140
|
});
|
|
143
141
|
```
|
|
@@ -154,8 +152,7 @@ This results in:
|
|
|
154
152
|
"a": 10
|
|
155
153
|
}
|
|
156
154
|
],
|
|
157
|
-
"_hash": "FfCIOVQsrK1g5o5_G-AxP4"
|
|
158
|
-
"_type": "ingredients"
|
|
155
|
+
"_hash": "FfCIOVQsrK1g5o5_G-AxP4"
|
|
159
156
|
}
|
|
160
157
|
}
|
|
161
158
|
```
|
|
@@ -168,8 +165,7 @@ table `b` references table `a` using `aRef`:
|
|
|
168
165
|
```json
|
|
169
166
|
{
|
|
170
167
|
"b": {
|
|
171
|
-
"_data": [{ "aRef": "LeFJOCQVgToOfbUuKJQ-GO" }]
|
|
172
|
-
"_type": "ingredients"
|
|
168
|
+
"_data": [{ "aRef": "LeFJOCQVgToOfbUuKJQ-GO" }]
|
|
173
169
|
}
|
|
174
170
|
}
|
|
175
171
|
```
|
|
@@ -189,7 +185,6 @@ key-value pairs assigning values to ingredient names.
|
|
|
189
185
|
```json
|
|
190
186
|
{
|
|
191
187
|
"ingredients": {
|
|
192
|
-
"_type": "ingredients",
|
|
193
188
|
"_data": [
|
|
194
189
|
{
|
|
195
190
|
"name": "flour",
|
|
@@ -200,7 +195,6 @@ key-value pairs assigning values to ingredient names.
|
|
|
200
195
|
},
|
|
201
196
|
|
|
202
197
|
"nutritionalValues": {
|
|
203
|
-
"_type": "ingredients",
|
|
204
198
|
"_data": [
|
|
205
199
|
{
|
|
206
200
|
"energy": 364,
|
|
@@ -223,7 +217,6 @@ following `SliceIds` define a set of three slice IDs:
|
|
|
223
217
|
```json
|
|
224
218
|
{
|
|
225
219
|
"slices": {
|
|
226
|
-
"_type": "sliceIds",
|
|
227
220
|
"_data": [
|
|
228
221
|
{
|
|
229
222
|
"add": ["slice0", "slice1"],
|
|
@@ -240,7 +233,6 @@ Derived `SliceIds` can be created by modifying an existing set:
|
|
|
240
233
|
```json
|
|
241
234
|
{
|
|
242
235
|
"slices": {
|
|
243
|
-
"_type": "sliceIds",
|
|
244
236
|
"_data": [
|
|
245
237
|
{
|
|
246
238
|
"add": ["slice0", "slice1"],
|
|
@@ -264,7 +256,6 @@ Cake layers assign ingredients to slices.
|
|
|
264
256
|
```json
|
|
265
257
|
{
|
|
266
258
|
"layers": {
|
|
267
|
-
"_type": "layers",
|
|
268
259
|
"_data": [
|
|
269
260
|
{
|
|
270
261
|
"ingredientsTable": "recipes",
|
|
@@ -288,7 +279,6 @@ Each layer assigns different ingredients to slices.
|
|
|
288
279
|
```json
|
|
289
280
|
{
|
|
290
281
|
"cakes": {
|
|
291
|
-
"_type": "cakes",
|
|
292
282
|
"_data": [
|
|
293
283
|
{
|
|
294
284
|
"sliceIdsTable": "slices",
|
|
@@ -314,7 +304,6 @@ such as cakes, layers, or ingredients:
|
|
|
314
304
|
```json
|
|
315
305
|
{
|
|
316
306
|
"buffets": {
|
|
317
|
-
"_type": "buffets",
|
|
318
307
|
"_data": [
|
|
319
308
|
{
|
|
320
309
|
"items": [
|
package/dist/example.d.ts
CHANGED
package/dist/rljson.js
CHANGED
|
@@ -6,7 +6,6 @@ import { exampleJsonObject, jsonValueTypes, jsonValueType, jsonValueMatchesType
|
|
|
6
6
|
// @license
|
|
7
7
|
const bakeryExample = () => {
|
|
8
8
|
const nutritionalValues = hip({
|
|
9
|
-
_type: "ingredients",
|
|
10
9
|
_data: [
|
|
11
10
|
{
|
|
12
11
|
id: "flour",
|
|
@@ -28,7 +27,6 @@ const bakeryExample = () => {
|
|
|
28
27
|
_hash: ""
|
|
29
28
|
});
|
|
30
29
|
const ingredients = hip({
|
|
31
|
-
_type: "ingredients",
|
|
32
30
|
_data: [
|
|
33
31
|
{
|
|
34
32
|
id: "flour",
|
|
@@ -40,7 +38,6 @@ const bakeryExample = () => {
|
|
|
40
38
|
_hash: ""
|
|
41
39
|
});
|
|
42
40
|
const recipeIngredients = hip({
|
|
43
|
-
_type: "ingredients",
|
|
44
41
|
_data: [
|
|
45
42
|
{
|
|
46
43
|
id: "flour",
|
|
@@ -52,7 +49,6 @@ const bakeryExample = () => {
|
|
|
52
49
|
_hash: ""
|
|
53
50
|
});
|
|
54
51
|
const slices = hip({
|
|
55
|
-
_type: "sliceIds",
|
|
56
52
|
_data: [
|
|
57
53
|
{
|
|
58
54
|
add: ["slice0", "slice1"],
|
|
@@ -61,7 +57,6 @@ const bakeryExample = () => {
|
|
|
61
57
|
]
|
|
62
58
|
});
|
|
63
59
|
const ingredientTypes = hip({
|
|
64
|
-
_type: "sliceIds",
|
|
65
60
|
_data: [
|
|
66
61
|
{
|
|
67
62
|
add: ["flour"],
|
|
@@ -70,7 +65,6 @@ const bakeryExample = () => {
|
|
|
70
65
|
]
|
|
71
66
|
});
|
|
72
67
|
const recipes = hip({
|
|
73
|
-
_type: "layers",
|
|
74
68
|
_data: [
|
|
75
69
|
{
|
|
76
70
|
id: "tastyCake",
|
|
@@ -85,7 +79,6 @@ const bakeryExample = () => {
|
|
|
85
79
|
]
|
|
86
80
|
});
|
|
87
81
|
const layers = hip({
|
|
88
|
-
_type: "layers",
|
|
89
82
|
_data: [
|
|
90
83
|
{
|
|
91
84
|
ingredientsTable: "recipes",
|
|
@@ -99,7 +92,6 @@ const bakeryExample = () => {
|
|
|
99
92
|
]
|
|
100
93
|
});
|
|
101
94
|
const cakes = hip({
|
|
102
|
-
_type: "cakes",
|
|
103
95
|
_data: [
|
|
104
96
|
{
|
|
105
97
|
id: "cake1",
|
|
@@ -113,7 +105,6 @@ const bakeryExample = () => {
|
|
|
113
105
|
]
|
|
114
106
|
});
|
|
115
107
|
const buffets = hip({
|
|
116
|
-
_type: "buffets",
|
|
117
108
|
_data: [
|
|
118
109
|
{
|
|
119
110
|
id: "salesCounter",
|
|
@@ -168,7 +159,6 @@ __publicField(_Example, "ok", {
|
|
|
168
159
|
binary: () => {
|
|
169
160
|
return {
|
|
170
161
|
table: {
|
|
171
|
-
_type: "ingredients",
|
|
172
162
|
_data: [
|
|
173
163
|
{ a: false, b: false },
|
|
174
164
|
{ a: false, b: true },
|
|
@@ -181,7 +171,6 @@ __publicField(_Example, "ok", {
|
|
|
181
171
|
singleRow: () => {
|
|
182
172
|
const tableCfgs = hip({
|
|
183
173
|
_hash: "",
|
|
184
|
-
_type: "ingredients",
|
|
185
174
|
_data: [
|
|
186
175
|
{
|
|
187
176
|
version: 0,
|
|
@@ -231,7 +220,6 @@ __publicField(_Example, "ok", {
|
|
|
231
220
|
const result = {
|
|
232
221
|
tableCfgs,
|
|
233
222
|
table: {
|
|
234
|
-
_type: "ingredients",
|
|
235
223
|
_tableCfg: tableCfgs._data[0]._hash,
|
|
236
224
|
_data: [exampleJsonObject()],
|
|
237
225
|
_hash: ""
|
|
@@ -242,7 +230,6 @@ __publicField(_Example, "ok", {
|
|
|
242
230
|
multipleRows: () => {
|
|
243
231
|
return {
|
|
244
232
|
table: {
|
|
245
|
-
_type: "ingredients",
|
|
246
233
|
_data: [
|
|
247
234
|
{
|
|
248
235
|
string: "str0",
|
|
@@ -272,7 +259,6 @@ __publicField(_Example, "ok", {
|
|
|
272
259
|
singleRef: () => {
|
|
273
260
|
return {
|
|
274
261
|
tableA: {
|
|
275
|
-
_type: "ingredients",
|
|
276
262
|
_data: [
|
|
277
263
|
{
|
|
278
264
|
keyA0: "a0"
|
|
@@ -283,7 +269,6 @@ __publicField(_Example, "ok", {
|
|
|
283
269
|
]
|
|
284
270
|
},
|
|
285
271
|
tableB: {
|
|
286
|
-
_type: "ingredients",
|
|
287
272
|
_data: [
|
|
288
273
|
{
|
|
289
274
|
tableARef: "KFQrf4mEz0UPmUaFHwH4T6"
|
|
@@ -294,7 +279,6 @@ __publicField(_Example, "ok", {
|
|
|
294
279
|
},
|
|
295
280
|
complete: () => {
|
|
296
281
|
const sliceIds = hip({
|
|
297
|
-
_type: "sliceIds",
|
|
298
282
|
_data: [
|
|
299
283
|
{
|
|
300
284
|
add: ["id0", "id1"]
|
|
@@ -302,7 +286,6 @@ __publicField(_Example, "ok", {
|
|
|
302
286
|
]
|
|
303
287
|
});
|
|
304
288
|
const ingredients = hip({
|
|
305
|
-
_type: "ingredients",
|
|
306
289
|
_data: [{ a: "0" }, { a: "1" }]
|
|
307
290
|
});
|
|
308
291
|
const ingredient0 = ingredients._data[0];
|
|
@@ -327,7 +310,6 @@ __publicField(_Example, "ok", {
|
|
|
327
310
|
}
|
|
328
311
|
});
|
|
329
312
|
const layers = hip({
|
|
330
|
-
_type: "layers",
|
|
331
313
|
_data: [layer0, layer1]
|
|
332
314
|
});
|
|
333
315
|
const cake = hip({
|
|
@@ -340,11 +322,9 @@ __publicField(_Example, "ok", {
|
|
|
340
322
|
}
|
|
341
323
|
});
|
|
342
324
|
const cakes = hip({
|
|
343
|
-
_type: "cakes",
|
|
344
325
|
_data: [cake]
|
|
345
326
|
});
|
|
346
327
|
const buffets = hip({
|
|
347
|
-
_type: "buffets",
|
|
348
328
|
_data: [
|
|
349
329
|
{
|
|
350
330
|
items: [
|
|
@@ -374,22 +354,18 @@ __publicField(_Example, "broken", {
|
|
|
374
354
|
brokenTableKey: () => {
|
|
375
355
|
return {
|
|
376
356
|
brok$en: {
|
|
377
|
-
_type: "ingredients",
|
|
378
357
|
_data: []
|
|
379
358
|
}
|
|
380
359
|
};
|
|
381
360
|
},
|
|
382
361
|
missingData: () => {
|
|
383
362
|
return {
|
|
384
|
-
table: {
|
|
385
|
-
_type: "ingredients"
|
|
386
|
-
}
|
|
363
|
+
table: {}
|
|
387
364
|
};
|
|
388
365
|
},
|
|
389
366
|
dataNotBeingAnArray: () => {
|
|
390
367
|
return {
|
|
391
368
|
table: {
|
|
392
|
-
_type: "ingredients",
|
|
393
369
|
_data: {}
|
|
394
370
|
}
|
|
395
371
|
};
|
|
@@ -397,7 +373,6 @@ __publicField(_Example, "broken", {
|
|
|
397
373
|
missingRef: () => {
|
|
398
374
|
return {
|
|
399
375
|
tableA: {
|
|
400
|
-
_type: "ingredients",
|
|
401
376
|
_data: [
|
|
402
377
|
{
|
|
403
378
|
keyA0: "a0"
|
|
@@ -408,7 +383,6 @@ __publicField(_Example, "broken", {
|
|
|
408
383
|
]
|
|
409
384
|
},
|
|
410
385
|
tableB: {
|
|
411
|
-
_type: "ingredients",
|
|
412
386
|
_data: [
|
|
413
387
|
{
|
|
414
388
|
tableARef: "MISSINGREF"
|
|
@@ -421,7 +395,6 @@ __publicField(_Example, "broken", {
|
|
|
421
395
|
missingReferencedTable: () => {
|
|
422
396
|
return {
|
|
423
397
|
tableB: {
|
|
424
|
-
_type: "ingredients",
|
|
425
398
|
_data: [
|
|
426
399
|
{
|
|
427
400
|
tableARef: "MISSINGREF"
|
|
@@ -655,7 +628,7 @@ const rljsonIndexed = (rljson) => {
|
|
|
655
628
|
return result;
|
|
656
629
|
};
|
|
657
630
|
// @license
|
|
658
|
-
const reservedFieldNames = ["
|
|
631
|
+
const reservedFieldNames = ["_data"];
|
|
659
632
|
const reservedTableKeys = [
|
|
660
633
|
"_hash",
|
|
661
634
|
"sliceIds",
|
|
@@ -1174,9 +1147,6 @@ class _BaseValidator {
|
|
|
1174
1147
|
_layerBasesNotFound() {
|
|
1175
1148
|
const brokenLayers = [];
|
|
1176
1149
|
iterateTablesSync(this.rljson, (tableKey, table) => {
|
|
1177
|
-
if (table._type !== "layers") {
|
|
1178
|
-
return;
|
|
1179
|
-
}
|
|
1180
1150
|
const layersIndexed = this.rljsonIndexed[tableKey];
|
|
1181
1151
|
const layersTable = table;
|
|
1182
1152
|
for (const layer of layersTable._data) {
|
|
@@ -1201,6 +1171,7 @@ class _BaseValidator {
|
|
|
1201
1171
|
};
|
|
1202
1172
|
}
|
|
1203
1173
|
}
|
|
1174
|
+
/* v8 ignore start */
|
|
1204
1175
|
_layerSliceIdsTableNotFound() {
|
|
1205
1176
|
const brokenLayers = [];
|
|
1206
1177
|
iterateTablesSync(this.rljson, (tableKey, table) => {
|
|
@@ -1486,6 +1457,7 @@ class _BaseValidator {
|
|
|
1486
1457
|
};
|
|
1487
1458
|
}
|
|
1488
1459
|
}
|
|
1460
|
+
/* v8 ignore end */
|
|
1489
1461
|
}
|
|
1490
1462
|
const isValidFieldName = (fieldName) => BaseValidator.isValidFieldName(fieldName);
|
|
1491
1463
|
// @license
|
package/dist/src/example.ts
CHANGED
|
@@ -27,7 +27,6 @@ export class Example {
|
|
|
27
27
|
binary: (): Rljson => {
|
|
28
28
|
return {
|
|
29
29
|
table: {
|
|
30
|
-
_type: 'ingredients',
|
|
31
30
|
_data: [
|
|
32
31
|
{ a: false, b: false },
|
|
33
32
|
{ a: false, b: true },
|
|
@@ -41,8 +40,6 @@ export class Example {
|
|
|
41
40
|
singleRow: (): Rljson => {
|
|
42
41
|
const tableCfgs = hip<TablesCfgTable>({
|
|
43
42
|
_hash: '',
|
|
44
|
-
|
|
45
|
-
_type: 'ingredients',
|
|
46
43
|
_data: [
|
|
47
44
|
{
|
|
48
45
|
version: 0,
|
|
@@ -93,7 +90,6 @@ export class Example {
|
|
|
93
90
|
const result: Rljson = {
|
|
94
91
|
tableCfgs: tableCfgs,
|
|
95
92
|
table: {
|
|
96
|
-
_type: 'ingredients',
|
|
97
93
|
_tableCfg: tableCfgs._data[0]._hash as string,
|
|
98
94
|
_data: [exampleJsonObject()],
|
|
99
95
|
_hash: '',
|
|
@@ -105,7 +101,6 @@ export class Example {
|
|
|
105
101
|
multipleRows: (): Rljson => {
|
|
106
102
|
return {
|
|
107
103
|
table: {
|
|
108
|
-
_type: 'ingredients',
|
|
109
104
|
_data: [
|
|
110
105
|
{
|
|
111
106
|
string: 'str0',
|
|
@@ -138,7 +133,6 @@ export class Example {
|
|
|
138
133
|
singleRef: (): Rljson => {
|
|
139
134
|
return {
|
|
140
135
|
tableA: {
|
|
141
|
-
_type: 'ingredients',
|
|
142
136
|
_data: [
|
|
143
137
|
{
|
|
144
138
|
keyA0: 'a0',
|
|
@@ -149,7 +143,6 @@ export class Example {
|
|
|
149
143
|
],
|
|
150
144
|
},
|
|
151
145
|
tableB: {
|
|
152
|
-
_type: 'ingredients',
|
|
153
146
|
_data: [
|
|
154
147
|
{
|
|
155
148
|
tableARef: 'KFQrf4mEz0UPmUaFHwH4T6',
|
|
@@ -160,7 +153,6 @@ export class Example {
|
|
|
160
153
|
},
|
|
161
154
|
complete: (): Rljson => {
|
|
162
155
|
const sliceIds = hip<SliceIdsTable>({
|
|
163
|
-
_type: 'sliceIds',
|
|
164
156
|
_data: [
|
|
165
157
|
{
|
|
166
158
|
add: ['id0', 'id1'],
|
|
@@ -169,7 +161,6 @@ export class Example {
|
|
|
169
161
|
});
|
|
170
162
|
|
|
171
163
|
const ingredients = hip<IngredientsTable<any>>({
|
|
172
|
-
_type: 'ingredients',
|
|
173
164
|
_data: [{ a: '0' }, { a: '1' }],
|
|
174
165
|
});
|
|
175
166
|
const ingredient0 = ingredients._data[0];
|
|
@@ -197,7 +188,6 @@ export class Example {
|
|
|
197
188
|
});
|
|
198
189
|
|
|
199
190
|
const layers = hip<LayersTable>({
|
|
200
|
-
_type: 'layers',
|
|
201
191
|
_data: [layer0, layer1],
|
|
202
192
|
} as LayersTable);
|
|
203
193
|
|
|
@@ -212,12 +202,10 @@ export class Example {
|
|
|
212
202
|
});
|
|
213
203
|
|
|
214
204
|
const cakes = hip<CakesTable>({
|
|
215
|
-
_type: 'cakes',
|
|
216
205
|
_data: [cake],
|
|
217
206
|
});
|
|
218
207
|
|
|
219
208
|
const buffets = hip<BuffetsTable>({
|
|
220
|
-
_type: 'buffets',
|
|
221
209
|
_data: [
|
|
222
210
|
{
|
|
223
211
|
items: [
|
|
@@ -249,7 +237,6 @@ export class Example {
|
|
|
249
237
|
brokenTableKey: () => {
|
|
250
238
|
return {
|
|
251
239
|
brok$en: {
|
|
252
|
-
_type: 'ingredients',
|
|
253
240
|
_data: [],
|
|
254
241
|
},
|
|
255
242
|
};
|
|
@@ -257,16 +244,13 @@ export class Example {
|
|
|
257
244
|
|
|
258
245
|
missingData: () => {
|
|
259
246
|
return {
|
|
260
|
-
table: {
|
|
261
|
-
_type: 'ingredients',
|
|
262
|
-
},
|
|
247
|
+
table: {},
|
|
263
248
|
} as unknown as Rljson;
|
|
264
249
|
},
|
|
265
250
|
|
|
266
251
|
dataNotBeingAnArray: () => {
|
|
267
252
|
return {
|
|
268
253
|
table: {
|
|
269
|
-
_type: 'ingredients',
|
|
270
254
|
_data: {},
|
|
271
255
|
},
|
|
272
256
|
} as unknown as Rljson;
|
|
@@ -275,7 +259,6 @@ export class Example {
|
|
|
275
259
|
missingRef: (): Rljson => {
|
|
276
260
|
return {
|
|
277
261
|
tableA: {
|
|
278
|
-
_type: 'ingredients',
|
|
279
262
|
_data: [
|
|
280
263
|
{
|
|
281
264
|
keyA0: 'a0',
|
|
@@ -286,7 +269,6 @@ export class Example {
|
|
|
286
269
|
],
|
|
287
270
|
},
|
|
288
271
|
tableB: {
|
|
289
|
-
_type: 'ingredients',
|
|
290
272
|
_data: [
|
|
291
273
|
{
|
|
292
274
|
tableARef: 'MISSINGREF', // MISSINGREF does not exist in tableA
|
|
@@ -299,7 +281,6 @@ export class Example {
|
|
|
299
281
|
missingReferencedTable: (): Rljson => {
|
|
300
282
|
return {
|
|
301
283
|
tableB: {
|
|
302
|
-
_type: 'ingredients',
|
|
303
284
|
_data: [
|
|
304
285
|
{
|
|
305
286
|
tableARef: 'MISSINGREF', // tableA is missing
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rljson/rljson",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"packageManager": "pnpm@10.
|
|
3
|
+
"version": "0.0.51",
|
|
4
|
+
"packageManager": "pnpm@10.11.0",
|
|
5
5
|
"description": "The RLJSON data format specification",
|
|
6
6
|
"homepage": "https://github.com/rljson/rljson",
|
|
7
7
|
"bugs": "https://github.com/rljson/rljson/issues",
|
|
@@ -29,28 +29,28 @@
|
|
|
29
29
|
"updateGoldens": "cross-env UPDATE_GOLDENS=true npm test"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "^22.15.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
34
|
-
"@typescript-eslint/parser": "^8.
|
|
35
|
-
"@vitest/coverage-v8": "^3.1.
|
|
32
|
+
"@types/node": "^22.15.17",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
34
|
+
"@typescript-eslint/parser": "^8.32.1",
|
|
35
|
+
"@vitest/coverage-v8": "^3.1.3",
|
|
36
36
|
"cross-env": "^7.0.3",
|
|
37
|
-
"eslint": "^9.
|
|
38
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
37
|
+
"eslint": "^9.26.0",
|
|
38
|
+
"eslint-plugin-jsdoc": "^50.6.14",
|
|
39
39
|
"eslint-plugin-tsdoc": "^0.4.0",
|
|
40
|
-
"globals": "^16.
|
|
40
|
+
"globals": "^16.1.0",
|
|
41
41
|
"jsdoc": "^4.0.4",
|
|
42
42
|
"read-pkg": "^9.0.1",
|
|
43
43
|
"typescript": "~5.8.3",
|
|
44
|
-
"typescript-eslint": "^8.
|
|
45
|
-
"vite": "^6.3.
|
|
46
|
-
"vite-node": "^3.1.
|
|
44
|
+
"typescript-eslint": "^8.32.1",
|
|
45
|
+
"vite": "^6.3.5",
|
|
46
|
+
"vite-node": "^3.1.3",
|
|
47
47
|
"vite-plugin-dts": "^4.5.3",
|
|
48
48
|
"vite-tsconfig-paths": "^5.1.4",
|
|
49
|
-
"vitest": "^3.1.
|
|
49
|
+
"vitest": "^3.1.3",
|
|
50
50
|
"vitest-dom": "^0.1.1"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@rljson/hash": "^0.0.
|
|
53
|
+
"@rljson/hash": "^0.0.16",
|
|
54
54
|
"@rljson/json": "^0.0.21"
|
|
55
55
|
},
|
|
56
56
|
"pnpm": {
|