@cratis/scene.engine 4.21.0 → 4.22.1
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/cjs/editing/validateValue.js +9 -1
- package/dist/cjs/editing/validateValue.js.map +1 -1
- package/dist/esm/editing/validateValue.d.ts.map +1 -1
- package/dist/esm/editing/validateValue.js +9 -1
- package/dist/esm/editing/validateValue.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/editing/validateValue.ts +10 -1
- package/package.json +3 -3
package/editing/validateValue.ts
CHANGED
|
@@ -137,7 +137,16 @@ function validateCollection(descriptor: PropertyDescriptor, value: unknown): str
|
|
|
137
137
|
if (constraints.maximumItems !== undefined && value.length > constraints.maximumItems) return `allows at most ${constraints.maximumItems} items`;
|
|
138
138
|
|
|
139
139
|
const identities = new Set<string>();
|
|
140
|
-
|
|
140
|
+
const positional = descriptor.item?.positional === true;
|
|
141
|
+
for (const [index, item] of value.entries()) {
|
|
142
|
+
if (positional) {
|
|
143
|
+
if (!isRecord(item)) return `item ${index + 1} is not a record`;
|
|
144
|
+
const { id: _identity, ...values } = item;
|
|
145
|
+
const problem = validateItemValues(descriptor.item, values).at(0);
|
|
146
|
+
if (problem) return `item ${index + 1}: ${problem.field} ${problem.problem}`;
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
|
|
141
150
|
if (!isRecord(item) || !isNonEmptyString(item.id)) return 'every item needs an id';
|
|
142
151
|
if (identities.has(item.id)) return `the item id '${item.id}' is used twice`;
|
|
143
152
|
identities.add(item.id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cratis/scene.engine",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.22.1",
|
|
4
4
|
"description": "The Scene runtime: walks a Scene element tree and drives whichever renderer is plugged in. Does not know React, or any other rendering platform, exists.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cratis",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"up": "yarn g:up"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@cratis/scene.model": "4.
|
|
51
|
+
"@cratis/scene.model": "4.22.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@cratis/scene.model": "4.
|
|
54
|
+
"@cratis/scene.model": "4.22.1"
|
|
55
55
|
}
|
|
56
56
|
}
|