@womp/kakapo-sdk 0.2.1 → 0.2.2
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/validation.js +1 -1
- package/package.json +1 -1
package/dist/validation.js
CHANGED
|
@@ -143,7 +143,7 @@ export function assertScene(scene, operation) {
|
|
|
143
143
|
if (!parentRaw)
|
|
144
144
|
fail(`Tree parent ${parentId} does not exist.`, operation, `tree.${parentId}`, parentId, "existing parent node", undefined, "MISSING_TREE_NODE");
|
|
145
145
|
const parentKind = kindFromWire(parentRaw.type);
|
|
146
|
-
if (!CONTAINERS.has(parentKind))
|
|
146
|
+
if (Object.keys(children).length > 0 && !CONTAINERS.has(parentKind))
|
|
147
147
|
fail(`Node ${parentId} (${parentKind}) cannot contain children.`, operation, `tree.${parentId}`, parentKind, "Union or Group parent", "Reparent the children under a Union or Group.", "LEAF_NODE_HAS_CHILDREN");
|
|
148
148
|
for (const childId of Object.values(children)) {
|
|
149
149
|
if (!scene.nodes[String(childId)])
|