(includeMatchingID = false)
| 325 | } |
| 326 | |
| 327 | serialize(includeMatchingID = false): SerializedNode { |
| 328 | const result = { |
| 329 | type: this.type, |
| 330 | properties: {}, |
| 331 | childSets: {}, |
| 332 | } as SerializedNode |
| 333 | if (includeMatchingID) { |
| 334 | result.matchingID = this.matchingID |
| 335 | } |
| 336 | for (const property in this.properties) { |
| 337 | result.properties[property] = this.properties[property] |
| 338 | } |
| 339 | if (this.metadata.size !== 0) { |
| 340 | result.meta = Object.fromEntries(this.metadata) |
| 341 | } |
| 342 | |
| 343 | this.childSetOrder.forEach((childSetId: string) => { |
| 344 | const childSet = this.getChildSet(childSetId) |
| 345 | result.childSets[childSetId] = [] |
| 346 | childSet.getChildren().forEach((node: SplootNode) => { |
| 347 | result.childSets[childSetId].push(node.serialize(includeMatchingID)) |
| 348 | }) |
| 349 | }) |
| 350 | return result |
| 351 | } |
| 352 | |
| 353 | applySerializedSnapshot(snapshot: SerializedNode) { |
| 354 | // Recursively apply the serialized snapshot to this node and children |
no test coverage detected