From f0c4c46a5ddad0ea38c65760043981eafb390b19 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 11 Feb 2022 23:11:59 -0800 Subject: [PATCH] Fix compilation --- packages/mindplot/src/components/Relationship.ts | 2 +- packages/mindplot/src/components/Topic.ts | 2 +- .../mindplot/src/components/commands/DeleteCommand.ts | 10 +++++++--- packages/mindplot/tsconfig.json | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/mindplot/src/components/Relationship.ts b/packages/mindplot/src/components/Relationship.ts index a3abb457..69397b36 100644 --- a/packages/mindplot/src/components/Relationship.ts +++ b/packages/mindplot/src/components/Relationship.ts @@ -38,7 +38,7 @@ class Relationship extends ConnectionLine { private _endArrow: Arrow; - private _controlPointControllerListener: any; + private _controlPointControllerListener; private _showStartArrow: Arrow; diff --git a/packages/mindplot/src/components/Topic.ts b/packages/mindplot/src/components/Topic.ts index 3e5f6989..83a41aea 100644 --- a/packages/mindplot/src/components/Topic.ts +++ b/packages/mindplot/src/components/Topic.ts @@ -1058,7 +1058,7 @@ abstract class Topic extends NodeGraph { } } - setSize(size: SizeType, force: boolean): void { + setSize(size: SizeType, force?: boolean): void { $assert(size, 'size can not be null'); $assert($defined(size.width), 'size seem not to be a valid element'); const roundedSize = { diff --git a/packages/mindplot/src/components/commands/DeleteCommand.ts b/packages/mindplot/src/components/commands/DeleteCommand.ts index e28b002b..c8019603 100644 --- a/packages/mindplot/src/components/commands/DeleteCommand.ts +++ b/packages/mindplot/src/components/commands/DeleteCommand.ts @@ -20,6 +20,7 @@ import Command from '../Command'; import CommandContext from '../CommandContext'; import NodeModel from '../model/NodeModel'; import RelationshipModel from '../model/RelationshipModel'; +import Relationship from '../Relationship'; import Topic from '../Topic'; class DeleteCommand extends Command { @@ -159,13 +160,16 @@ class DeleteCommand extends Command { return result; } - _collectInDepthRelationships(topic: Topic) { + private _collectInDepthRelationships(topic: Topic): Relationship[] { let result = []; result = result.concat(topic.getRelationships()); const children = topic.getChildren(); - const rels = children.map(((t) => this._collectInDepthRelationships(t))); - result = result.concat(rels.flat()); + const rels: (Relationship[])[] = children + .map(((t: Topic) => this._collectInDepthRelationships(t))); + + // flatten and concact + result = result.concat(([].concat(...rels))); if (result.length > 0) { // Filter for unique ... diff --git a/packages/mindplot/tsconfig.json b/packages/mindplot/tsconfig.json index c342a977..379d8747 100644 --- a/packages/mindplot/tsconfig.json +++ b/packages/mindplot/tsconfig.json @@ -5,7 +5,7 @@ "noImplicitAny": false, "module": "amd", "moduleResolution": "node", - "target": "es6", + "target": "ES2020", "allowJs": true, "esModuleInterop": true, "declaration": true,