@rljson/rljson 0.0.30 → 0.0.31
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 +1 -1
- package/dist/content/collection.d.ts +1 -1
- package/dist/rljson.js +9 -9
- package/dist/src/example.ts +4 -4
- package/package.json +1 -1
package/dist/content/cake.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface Collection extends Json {
|
|
|
28
28
|
* The table containing the properties that are assigned to the items
|
|
29
29
|
* with the assign property below
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
propertiesTable: TableKey;
|
|
32
32
|
/**
|
|
33
33
|
* Assign properties to each item of the collection.
|
|
34
34
|
*/
|
package/dist/rljson.js
CHANGED
|
@@ -45,7 +45,7 @@ const bakeryExample = () => {
|
|
|
45
45
|
_type: "collections",
|
|
46
46
|
_data: [
|
|
47
47
|
{
|
|
48
|
-
|
|
48
|
+
propertiesTable: "recipeIngredients",
|
|
49
49
|
assign: {
|
|
50
50
|
flour: recipeIngredients._data[0]._hash
|
|
51
51
|
},
|
|
@@ -57,7 +57,7 @@ const bakeryExample = () => {
|
|
|
57
57
|
_type: "collections",
|
|
58
58
|
_data: [
|
|
59
59
|
{
|
|
60
|
-
|
|
60
|
+
propertiesTable: "recipes",
|
|
61
61
|
assign: {
|
|
62
62
|
slice0: recipes._data[0]._hash,
|
|
63
63
|
slice1: recipes._data[0]._hash
|
|
@@ -82,7 +82,7 @@ const bakeryExample = () => {
|
|
|
82
82
|
{
|
|
83
83
|
idSetsTable: "slices",
|
|
84
84
|
idSet: slices._data[0]._hash,
|
|
85
|
-
|
|
85
|
+
collectionsTable: "layers",
|
|
86
86
|
layers: {
|
|
87
87
|
flour: layers._data[0]._hash
|
|
88
88
|
},
|
|
@@ -275,14 +275,14 @@ __publicField(_Example, "ok", {
|
|
|
275
275
|
const collection0 = hip({
|
|
276
276
|
idSetsTable: "idSets",
|
|
277
277
|
idSet: "MgHRBYSrhpyl4rvsOmAWcQ",
|
|
278
|
-
|
|
278
|
+
propertiesTable: "properties",
|
|
279
279
|
assign: {}
|
|
280
280
|
});
|
|
281
281
|
const collection1 = hip({
|
|
282
282
|
base: collection0._hash,
|
|
283
283
|
idSetsTable: "idSets",
|
|
284
284
|
idSet: "MgHRBYSrhpyl4rvsOmAWcQ",
|
|
285
|
-
|
|
285
|
+
propertiesTable: "properties",
|
|
286
286
|
assign: {
|
|
287
287
|
id0: property0._hash,
|
|
288
288
|
id1: property1._hash
|
|
@@ -295,7 +295,7 @@ __publicField(_Example, "ok", {
|
|
|
295
295
|
const cake = hip({
|
|
296
296
|
idSetsTable: "idSets",
|
|
297
297
|
idSet: idSets._data[0]._hash,
|
|
298
|
-
|
|
298
|
+
collectionsTable: "collections",
|
|
299
299
|
layers: {
|
|
300
300
|
layer0: collection0._hash,
|
|
301
301
|
layer1: collection1._hash
|
|
@@ -435,7 +435,7 @@ __publicField(_Example, "broken", {
|
|
|
435
435
|
},
|
|
436
436
|
missingCollectionsTable: () => {
|
|
437
437
|
const result = _Example.ok.complete();
|
|
438
|
-
result.cakes._data[0].
|
|
438
|
+
result.cakes._data[0].collectionsTable = "MISSING";
|
|
439
439
|
hip(result.cakes, true, false);
|
|
440
440
|
return result;
|
|
441
441
|
},
|
|
@@ -1075,7 +1075,7 @@ class _BaseValidator {
|
|
|
1075
1075
|
}
|
|
1076
1076
|
const collectionsTable = table;
|
|
1077
1077
|
for (const collection of collectionsTable._data) {
|
|
1078
|
-
const propertyTableKey = collection.
|
|
1078
|
+
const propertyTableKey = collection.propertiesTable;
|
|
1079
1079
|
const propertiesTable = this.rljsonIndexed[propertyTableKey];
|
|
1080
1080
|
if (!propertiesTable) {
|
|
1081
1081
|
missingPropertyTables.push({
|
|
@@ -1185,7 +1185,7 @@ class _BaseValidator {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
const cakesTable = table;
|
|
1187
1187
|
for (const cake of cakesTable._data) {
|
|
1188
|
-
const collectionsTableKey = cake.
|
|
1188
|
+
const collectionsTableKey = cake.collectionsTable;
|
|
1189
1189
|
const collectionsTable = this.rljsonIndexed[collectionsTableKey];
|
|
1190
1190
|
if (!collectionsTable) {
|
|
1191
1191
|
missingCollectionTables.push({
|
package/dist/src/example.ts
CHANGED
|
@@ -175,7 +175,7 @@ export class Example {
|
|
|
175
175
|
const collection0: Collection = hip({
|
|
176
176
|
idSetsTable: 'idSets',
|
|
177
177
|
idSet: 'MgHRBYSrhpyl4rvsOmAWcQ',
|
|
178
|
-
|
|
178
|
+
propertiesTable: 'properties',
|
|
179
179
|
assign: {},
|
|
180
180
|
});
|
|
181
181
|
|
|
@@ -183,7 +183,7 @@ export class Example {
|
|
|
183
183
|
base: collection0._hash as string,
|
|
184
184
|
idSetsTable: 'idSets',
|
|
185
185
|
idSet: 'MgHRBYSrhpyl4rvsOmAWcQ',
|
|
186
|
-
|
|
186
|
+
propertiesTable: 'properties',
|
|
187
187
|
assign: {
|
|
188
188
|
id0: property0._hash,
|
|
189
189
|
id1: property1._hash,
|
|
@@ -198,7 +198,7 @@ export class Example {
|
|
|
198
198
|
const cake: Cake = hip({
|
|
199
199
|
idSetsTable: 'idSets',
|
|
200
200
|
idSet: idSets._data[0]._hash as string,
|
|
201
|
-
|
|
201
|
+
collectionsTable: 'collections',
|
|
202
202
|
layers: {
|
|
203
203
|
layer0: collection0._hash as string,
|
|
204
204
|
layer1: collection1._hash as string,
|
|
@@ -356,7 +356,7 @@ export class Example {
|
|
|
356
356
|
|
|
357
357
|
missingCollectionsTable: (): Rljson => {
|
|
358
358
|
const result = Example.ok.complete();
|
|
359
|
-
result.cakes._data[0].
|
|
359
|
+
result.cakes._data[0].collectionsTable = 'MISSING'; // Missing collections table
|
|
360
360
|
hip(result.cakes, true, false);
|
|
361
361
|
return result;
|
|
362
362
|
},
|