@rljson/rljson 0.0.32 → 0.0.33
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/dist/content/cake.d.ts +2 -2
- package/dist/content/layer.d.ts +1 -1
- package/dist/rljson.js +19 -19
- package/dist/src/example.ts +5 -5
- package/package.json +2 -2
package/dist/content/cake.d.ts
CHANGED
|
@@ -19,11 +19,11 @@ export interface Cake extends Json {
|
|
|
19
19
|
* must match these slice ids of the layers.
|
|
20
20
|
* The slice ids can be found in the idSet table.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
sliceIds: SliceIdsRef;
|
|
23
23
|
/**
|
|
24
24
|
* The table containing the slice ids of the layer
|
|
25
25
|
*/
|
|
26
|
-
sliceIdsTable
|
|
26
|
+
sliceIdsTable: TableKey;
|
|
27
27
|
/**
|
|
28
28
|
* The table containing the slice layers defining the layers
|
|
29
29
|
*/
|
package/dist/content/layer.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface Layer extends Json {
|
|
|
19
19
|
* The item ids of the layer. If present, the item ids in `assign`
|
|
20
20
|
* must match these ids. The item id sets can be found in the sliceIds table.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
sliceIds?: SliceIdsRef;
|
|
23
23
|
/**
|
|
24
24
|
* The table containing the item ids of the layer
|
|
25
25
|
*/
|
package/dist/rljson.js
CHANGED
|
@@ -81,7 +81,7 @@ const bakeryExample = () => {
|
|
|
81
81
|
_data: [
|
|
82
82
|
{
|
|
83
83
|
sliceIdsTable: "slices",
|
|
84
|
-
|
|
84
|
+
sliceIds: slices._data[0]._hash,
|
|
85
85
|
layersTable: "layers",
|
|
86
86
|
layers: {
|
|
87
87
|
flour: layers._data[0]._hash
|
|
@@ -274,14 +274,14 @@ __publicField(_Example, "ok", {
|
|
|
274
274
|
const ingredient1 = ingredients._data[1];
|
|
275
275
|
const layer0 = hip({
|
|
276
276
|
sliceIdsTable: "sliceIds",
|
|
277
|
-
|
|
277
|
+
sliceIds: "MgHRBYSrhpyl4rvsOmAWcQ",
|
|
278
278
|
ingredientsTable: "ingredients",
|
|
279
279
|
assign: {}
|
|
280
280
|
});
|
|
281
281
|
const layer1 = hip({
|
|
282
282
|
base: layer0._hash,
|
|
283
283
|
sliceIdsTable: "sliceIds",
|
|
284
|
-
|
|
284
|
+
sliceIds: "MgHRBYSrhpyl4rvsOmAWcQ",
|
|
285
285
|
ingredientsTable: "ingredients",
|
|
286
286
|
assign: {
|
|
287
287
|
id0: ingredient0._hash,
|
|
@@ -294,7 +294,7 @@ __publicField(_Example, "ok", {
|
|
|
294
294
|
});
|
|
295
295
|
const cake = hip({
|
|
296
296
|
sliceIdsTable: "sliceIds",
|
|
297
|
-
|
|
297
|
+
sliceIds: sliceIds._data[0]._hash,
|
|
298
298
|
layersTable: "layers",
|
|
299
299
|
layers: {
|
|
300
300
|
layer0: layer0._hash,
|
|
@@ -412,7 +412,7 @@ __publicField(_Example, "broken", {
|
|
|
412
412
|
missingSliceIdSet: () => {
|
|
413
413
|
const result = _Example.ok.complete();
|
|
414
414
|
const layer1 = result.layers._data[1];
|
|
415
|
-
layer1.
|
|
415
|
+
layer1.sliceIds = "MISSING1";
|
|
416
416
|
return hip(result, true, false);
|
|
417
417
|
},
|
|
418
418
|
missingAssignedIngredientTable: () => {
|
|
@@ -429,7 +429,7 @@ __publicField(_Example, "broken", {
|
|
|
429
429
|
cakes: {
|
|
430
430
|
missingSliceIdSet: () => {
|
|
431
431
|
const result = _Example.ok.complete();
|
|
432
|
-
result.cakes._data[0].
|
|
432
|
+
result.cakes._data[0].sliceIds = "MISSING";
|
|
433
433
|
hip(result.cakes, true, false);
|
|
434
434
|
return result;
|
|
435
435
|
},
|
|
@@ -1043,7 +1043,7 @@ class _BaseValidator {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
const layersTable = table;
|
|
1045
1045
|
for (const layer of layersTable._data) {
|
|
1046
|
-
const idSetRef = layer.
|
|
1046
|
+
const idSetRef = layer.sliceIds;
|
|
1047
1047
|
if (!idSetRef) {
|
|
1048
1048
|
continue;
|
|
1049
1049
|
}
|
|
@@ -1124,16 +1124,16 @@ class _BaseValidator {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
const cakesTable = table;
|
|
1126
1126
|
for (const cake of cakesTable._data) {
|
|
1127
|
-
const
|
|
1128
|
-
if (!
|
|
1127
|
+
const sliceIdsTableName = cake.sliceIdsTable;
|
|
1128
|
+
if (!sliceIdsTableName) {
|
|
1129
1129
|
continue;
|
|
1130
1130
|
}
|
|
1131
|
-
const
|
|
1132
|
-
if (!
|
|
1131
|
+
const sliceIdsTable = this.rljsonIndexed[sliceIdsTableName];
|
|
1132
|
+
if (!sliceIdsTable) {
|
|
1133
1133
|
brokenCakes.push({
|
|
1134
1134
|
cakeTable: tableKey,
|
|
1135
1135
|
brokenCake: cake._hash,
|
|
1136
|
-
|
|
1136
|
+
missingSliceIdsTable: sliceIdsTableName
|
|
1137
1137
|
});
|
|
1138
1138
|
}
|
|
1139
1139
|
}
|
|
@@ -1153,18 +1153,18 @@ class _BaseValidator {
|
|
|
1153
1153
|
}
|
|
1154
1154
|
const cakesTable = table;
|
|
1155
1155
|
for (const cake of cakesTable._data) {
|
|
1156
|
-
const
|
|
1157
|
-
if (!
|
|
1156
|
+
const sliceIdsRef = cake.sliceIds;
|
|
1157
|
+
if (!sliceIdsRef) {
|
|
1158
1158
|
continue;
|
|
1159
1159
|
}
|
|
1160
|
-
const
|
|
1161
|
-
const
|
|
1162
|
-
const
|
|
1163
|
-
if (!
|
|
1160
|
+
const sliceIdsTableName = cake.sliceIdsTable;
|
|
1161
|
+
const sliceIdsTable = this.rljsonIndexed[sliceIdsTableName];
|
|
1162
|
+
const sliceIds = sliceIdsTable._data[sliceIdsRef];
|
|
1163
|
+
if (!sliceIds) {
|
|
1164
1164
|
brokenCakes.push({
|
|
1165
1165
|
cakeTable: tableKey,
|
|
1166
1166
|
brokenCake: cake._hash,
|
|
1167
|
-
missingSliceIds:
|
|
1167
|
+
missingSliceIds: sliceIdsRef
|
|
1168
1168
|
});
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
package/dist/src/example.ts
CHANGED
|
@@ -174,7 +174,7 @@ export class Example {
|
|
|
174
174
|
|
|
175
175
|
const layer0: Layer = hip({
|
|
176
176
|
sliceIdsTable: 'sliceIds',
|
|
177
|
-
|
|
177
|
+
sliceIds: 'MgHRBYSrhpyl4rvsOmAWcQ',
|
|
178
178
|
ingredientsTable: 'ingredients',
|
|
179
179
|
assign: {},
|
|
180
180
|
});
|
|
@@ -182,7 +182,7 @@ export class Example {
|
|
|
182
182
|
const layer1: Layer = hip({
|
|
183
183
|
base: layer0._hash as string,
|
|
184
184
|
sliceIdsTable: 'sliceIds',
|
|
185
|
-
|
|
185
|
+
sliceIds: 'MgHRBYSrhpyl4rvsOmAWcQ',
|
|
186
186
|
ingredientsTable: 'ingredients',
|
|
187
187
|
assign: {
|
|
188
188
|
id0: ingredient0._hash,
|
|
@@ -197,7 +197,7 @@ export class Example {
|
|
|
197
197
|
|
|
198
198
|
const cake: Cake = hip({
|
|
199
199
|
sliceIdsTable: 'sliceIds',
|
|
200
|
-
|
|
200
|
+
sliceIds: sliceIds._data[0]._hash as string,
|
|
201
201
|
layersTable: 'layers',
|
|
202
202
|
layers: {
|
|
203
203
|
layer0: layer0._hash as string,
|
|
@@ -327,7 +327,7 @@ export class Example {
|
|
|
327
327
|
const result = Example.ok.complete();
|
|
328
328
|
const layer1 = result.layers._data[1];
|
|
329
329
|
|
|
330
|
-
layer1.
|
|
330
|
+
layer1.sliceIds = 'MISSING1';
|
|
331
331
|
|
|
332
332
|
// Recalculate hashes
|
|
333
333
|
return hip(result, true, false);
|
|
@@ -349,7 +349,7 @@ export class Example {
|
|
|
349
349
|
cakes: {
|
|
350
350
|
missingSliceIdSet: (): Rljson => {
|
|
351
351
|
const result = Example.ok.complete();
|
|
352
|
-
result.cakes._data[0].
|
|
352
|
+
result.cakes._data[0].sliceIds = 'MISSING'; // Missing ID set
|
|
353
353
|
hip(result.cakes, true, false);
|
|
354
354
|
return result;
|
|
355
355
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rljson/rljson",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"packageManager": "pnpm@10.6.3",
|
|
5
5
|
"description": "The RLJSON data format specification",
|
|
6
6
|
"homepage": "https://github.com/rljson/rljson",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"updateGoldens": "cross-env UPDATE_GOLDENS=true npm test"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "^22.13.
|
|
32
|
+
"@types/node": "^22.13.14",
|
|
33
33
|
"@typescript-eslint/eslint-plugin": "^8.28.0",
|
|
34
34
|
"@typescript-eslint/parser": "^8.28.0",
|
|
35
35
|
"@vitest/coverage-v8": "^3.0.9",
|