diff --git a/packages/core/src/storage/FreLionwebSerializer.ts b/packages/core/src/storage/FreLionwebSerializer.ts index 105ec6c2d..1a7d7e80b 100644 --- a/packages/core/src/storage/FreLionwebSerializer.ts +++ b/packages/core/src/storage/FreLionwebSerializer.ts @@ -3,7 +3,7 @@ import { FreLanguage, FreLanguageProperty } from "../language"; import { FreLogger } from "../logging/index"; import { FreUtils, isNullOrUndefined, jsonAsString } from "../util"; import { FreSerializer } from "./FreSerializer"; -import { createLwNode, isLwChunk, LwChild, LwChunk, LwMetaPointer, LwNode, LwReference } from "./LionwebM3"; +import { createLwNode, isLwChunk, LwContainment, LwChunk, LwMetaPointer, LwNode, LwReference } from "./LionwebM3"; const LOGGER = new FreLogger("FreLionwebSerializer"); /** @@ -209,7 +209,7 @@ export class FreLionwebSerializer implements FreSerializer { } private convertChildProperties(freNode: FreNode, concept: string, jsonObject: LwNode): ParsedChild[] { - const jsonChildren = jsonObject.children; + const jsonChildren = jsonObject.containments; FreUtils.CHECK(Array.isArray(jsonChildren), "Found children value which is not a Array for node: " + jsonObject.id); const parsedChildren: ParsedChild[] = []; for (const jsonChild of Object.values(jsonChildren)) { @@ -372,7 +372,7 @@ export class FreLionwebSerializer implements FreSerializer { LOGGER.log("PART is null: " + + parentNode["name"] + "." + p.name); break; } - const child: LwChild = { + const child: LwContainment = { containment: this.createMetaPointer(p.key, p.language), children: [] }; @@ -385,7 +385,7 @@ export class FreLionwebSerializer implements FreSerializer { // single value child.children.push((!!value ? this.convertToJSONinternal(value as FreNode, publicOnly, idMap) : null).id); } - result.children.push(child); + result.containments.push(child); break; case "reference": const lwReference: LwReference = { diff --git a/packages/core/src/storage/LionwebM3.ts b/packages/core/src/storage/LionwebM3.ts index 939b6b0a3..2ea738838 100644 --- a/packages/core/src/storage/LionwebM3.ts +++ b/packages/core/src/storage/LionwebM3.ts @@ -46,7 +46,7 @@ export type LwNode = { id: Id; classifier: LwMetaPointer; properties: LwProperty[]; - children: LwChild[]; + containments: LwContainment[]; references: LwReference[]; parent: string; } @@ -56,7 +56,7 @@ export function isLwNode(box: any): box is LwNode { return lwNode.id !== undefined && lwNode.classifier !== undefined && lwNode.properties !== undefined && - lwNode.children !== undefined && + lwNode.containments !== undefined && lwNode.references !== undefined && lwNode.parent !== undefined; } @@ -66,7 +66,7 @@ export function createLwNode(): LwNode { id: null, classifier: null, properties: [], - children: [], + containments: [], references: [], parent: null } @@ -83,13 +83,13 @@ export function isLwProperty(obj: any): obj is LwProperty { lwProperty.value !== undefined; } -export type LwChild = { +export type LwContainment = { containment: LwMetaPointer; children: string[]; } -export function isLwChild(obj: any): obj is LwChild { - const lwChild = obj as LwChild; +export function isLwChild(obj: any): obj is LwContainment { + const lwChild = obj as LwContainment; return lwChild.containment !== undefined && lwChild.children !== undefined; }