@woosh/meep-engine 2.98.2 → 2.99.0
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/build/meep.cjs +19 -1
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +19 -1
- package/package.json +1 -1
- package/src/core/events/signal/Signal.d.ts.map +1 -1
- package/src/core/events/signal/Signal.js +2 -2
- package/src/core/events/signal/SignalBinding.d.ts +8 -0
- package/src/core/events/signal/SignalBinding.d.ts.map +1 -1
- package/src/core/events/signal/SignalBinding.js +17 -0
- package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
- package/src/core/model/node-graph/NodeGraph.js +9 -11
- package/src/core/model/node-graph/node/NodeDescription.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeDescription.js +9 -8
- package/src/core/model/node-graph/node/NodeDescription.spec.js +17 -1
package/build/meep.module.js
CHANGED
|
@@ -1145,8 +1145,9 @@ class Signal {
|
|
|
1145
1145
|
|
|
1146
1146
|
/**
|
|
1147
1147
|
* Remove all handlers.
|
|
1148
|
-
* Please note that this will remove even all handlers, irrespective of where they were added from.
|
|
1148
|
+
* Please note that this will remove even all handlers, irrespective of where they were added from. If another script is attaching to the same signal, using this method will potentially break that code.
|
|
1149
1149
|
* For most use cases, prefer to use {@link remove} method instead, or make use of {@link SignalBinding} if you need to keep track of multiple handlers
|
|
1150
|
+
* NOTE: Consider this method to be unsafe, only use it when you understand the implications
|
|
1150
1151
|
*/
|
|
1151
1152
|
removeAll() {
|
|
1152
1153
|
const handlers = this.handlers;
|
|
@@ -68238,6 +68239,23 @@ class SignalBinding {
|
|
|
68238
68239
|
this.#linked = false;
|
|
68239
68240
|
this.signal.remove(this.handler, this.context);
|
|
68240
68241
|
}
|
|
68242
|
+
|
|
68243
|
+
/**
|
|
68244
|
+
* Creates a {@link SignalBinding} and links it immediately. Utility method
|
|
68245
|
+
* @param {Signal} signal
|
|
68246
|
+
* @param {function} handler
|
|
68247
|
+
* @param {*} [context]
|
|
68248
|
+
* @return {SignalBinding}
|
|
68249
|
+
*/
|
|
68250
|
+
static bind(
|
|
68251
|
+
signal, handler, context
|
|
68252
|
+
) {
|
|
68253
|
+
const r = new SignalBinding(signal, handler, context);
|
|
68254
|
+
|
|
68255
|
+
r.link();
|
|
68256
|
+
|
|
68257
|
+
return r;
|
|
68258
|
+
}
|
|
68241
68259
|
}
|
|
68242
68260
|
|
|
68243
68261
|
/**
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Signal.d.ts","sourceRoot":"","sources":["../../../../../src/core/events/signal/Signal.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Signal.d.ts","sourceRoot":"","sources":["../../../../../src/core/events/signal/Signal.js"],"names":[],"mappings":"AAslBA;;;;;;GAMG;AACH,yDALW,aAAa,EAAE,+BAGb,MAAM,CAoBlB;AAED;;;;;;GAMG;AACH,mEALW,aAAa,EAAE,0BAGb,MAAM,CAclB;AAiDD;;;;GAIG;AACH,2CAHW,aAAa,EAAE,sBA8BzB;AAlsBD;;;;GAIG;AACH;IACI;;;OAGG;IACH,iBAAc;IAEd;;;;OAIG;IACH,cAAU;IAWV;;;OAGG;IACH,yBAEC;IAfD;;;OAGG;IACH,sBAEC;IAYD;;;;OAIG;IACH,cAHW,MAAM;;KAAY,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM;;KAAY,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM;;KAAY,SAClB,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM;;KAAY,GAChB,OAAO,CAInB;IAGD;;;;;OAKG;IACH,4CAFa,OAAO,CAQnB;IAED,aAEC;IAED,eAEC;IAED;;;OAGG;IACH,eAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,yCAQC;IAED;;;;OAIG;IACH,sCAYC;IAED;;;;;OAKG;IACH,oCAFa,OAAO,CAUnB;IAED;;;;;OAKG;IACH,kBAGC;IAED;;;OAGG;IACH,+BAQC;IAED;;;OAGG;IACH,cA4CC;IAED;;;;OAIG;IACH,sBA6CC;IAED;;;;OAIG;IACH,4BA4CC;IAED;;;;;OAKG;IACH,oCA4CC;IAED;;;;;;OAMG;IACH,4CA4CC;IAED;;;;;;;;OAQG;IACH,4DA4CC;IAED;;;;;;;;;;OAUG;IACH,4EA4CC;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,MAAM,CAalB;IAIL;;;OAGG;IACH,mBAFU,OAAO,CAEQ;CAPxB;;8BApkBiD,oBAAoB"}
|
|
@@ -177,9 +177,9 @@ export class Signal {
|
|
|
177
177
|
|
|
178
178
|
/**
|
|
179
179
|
* Remove all handlers.
|
|
180
|
-
* Please note that this will remove even all handlers, irrespective of where they were added from.
|
|
180
|
+
* Please note that this will remove even all handlers, irrespective of where they were added from. If another script is attaching to the same signal, using this method will potentially break that code.
|
|
181
181
|
* For most use cases, prefer to use {@link remove} method instead, or make use of {@link SignalBinding} if you need to keep track of multiple handlers
|
|
182
|
-
* NOTE: Consider
|
|
182
|
+
* NOTE: Consider this method to be unsafe, only use it when you understand the implications
|
|
183
183
|
*/
|
|
184
184
|
removeAll() {
|
|
185
185
|
const handlers = this.handlers;
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
* Utility class for managing connection between listeners to signals
|
|
3
3
|
*/
|
|
4
4
|
export class SignalBinding {
|
|
5
|
+
/**
|
|
6
|
+
* Creates a {@link SignalBinding} and links it immediately. Utility method
|
|
7
|
+
* @param {Signal} signal
|
|
8
|
+
* @param {function} handler
|
|
9
|
+
* @param {*} [context]
|
|
10
|
+
* @return {SignalBinding}
|
|
11
|
+
*/
|
|
12
|
+
static bind(signal: Signal, handler: Function, context?: any): SignalBinding;
|
|
5
13
|
/**
|
|
6
14
|
*
|
|
7
15
|
* @param {Signal} signal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignalBinding.d.ts","sourceRoot":"","sources":["../../../../../src/core/events/signal/SignalBinding.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"SignalBinding.d.ts","sourceRoot":"","sources":["../../../../../src/core/events/signal/SignalBinding.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IA6EI;;;;;;OAMG;IACH,+DAFY,aAAa,CAUxB;IAjFD;;;;;;OAMG;IACH,8DA+BC;IA1CD,sBAEC;IAsBG;;;OAGG;IACH,eAAoB;IAEpB;;;OAGG;IACH,kBAAsB;IAEtB;;;OAGG;IACH,aAAsB;IAI1B;;;OAGG;IACH,aAOC;IAED;;;OAGG;IACH,eAOC;;CAkBJ"}
|
|
@@ -77,4 +77,21 @@ export class SignalBinding {
|
|
|
77
77
|
this.#linked = false;
|
|
78
78
|
this.signal.remove(this.handler, this.context);
|
|
79
79
|
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Creates a {@link SignalBinding} and links it immediately. Utility method
|
|
83
|
+
* @param {Signal} signal
|
|
84
|
+
* @param {function} handler
|
|
85
|
+
* @param {*} [context]
|
|
86
|
+
* @return {SignalBinding}
|
|
87
|
+
*/
|
|
88
|
+
static bind(
|
|
89
|
+
signal, handler, context
|
|
90
|
+
) {
|
|
91
|
+
const r = new SignalBinding(signal, handler, context);
|
|
92
|
+
|
|
93
|
+
r.link();
|
|
94
|
+
|
|
95
|
+
return r;
|
|
96
|
+
}
|
|
80
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeGraph.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/NodeGraph.js"],"names":[],"mappings":"AASA;IAEI;;;OAGG;IACH,cAAmB;IAEnB;;;OAGG;IACH,oBAAyB;IAEzB;;;;OAIG;IACH,mBAA0B;IAE1B;;;;OAIG;IACH,yBAAgC;IAEhC;;OAEG;IACH;QACI;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;MAEL;IAEF;;OAEG;IACH,cAMC;IAED;;;OAGG;IACH,YAFW,SAAS,QAYnB;IAED;;;OAGG;IACH,SAFa,SAAS,CAQrB;IAED;;;;;;OAMG;IACH,aAHW,SAAS,GACP;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAY5D;IAED;;;;;;;;OAQG;IACH,sCAJW,YAAY,EAAE,GAEZ;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAwE5D;IAED;;;;OAIG;IACH,8BAHoB,YAAY,+BAK/B;IAED;;;;OAIG;IACH,oCAHoB,UAAU,+BAK7B;IAED;;;OAGG;IACH,YAFY,YAAY,EAAE,CAIzB;IAED;;;OAGG;IACH,kBAFY,UAAU,EAAE,CAIvB;IAED;;;;OAIG;IACH,cAHW,YAAY,GACV,OAAO,CAenB;IAED;;;;OAIG;IACH,qDAFa,YAAY,EAAE,CAqB1B;IAED;;;;OAIG;IACH,0DAFa,YAAY,EAAE,CAqB1B;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,YAAY,GAAC,SAAS,CAkBlC;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,YAAY,CAUxB;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,UAAU,GAAC,SAAS,CAgBhC;IAED;;;;;OAKG;IACH,+BAJW,MAAM,WACN,MAAM,GACJ,4BAA0B,SAAS,CAY/C;IAED;;;;OAIG;IACH,mCAFa,MAAM,CAclB;IAED;;;OAGG;IACH,cAFW,YAAY,QAgBtB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CA4BnB;IAED;;;;;;;;OAQG;IACH,uCANW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,MAAM,CAqClB;IAED;;;;;;;OAOG;IACH,6BANW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,MAAM,
|
|
1
|
+
{"version":3,"file":"NodeGraph.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/NodeGraph.js"],"names":[],"mappings":"AASA;IAEI;;;OAGG;IACH,cAAmB;IAEnB;;;OAGG;IACH,oBAAyB;IAEzB;;;;OAIG;IACH,mBAA0B;IAE1B;;;;OAIG;IACH,yBAAgC;IAEhC;;OAEG;IACH;QACI;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;MAEL;IAEF;;OAEG;IACH,cAMC;IAED;;;OAGG;IACH,YAFW,SAAS,QAYnB;IAED;;;OAGG;IACH,SAFa,SAAS,CAQrB;IAED;;;;;;OAMG;IACH,aAHW,SAAS,GACP;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAY5D;IAED;;;;;;;;OAQG;IACH,sCAJW,YAAY,EAAE,GAEZ;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAwE5D;IAED;;;;OAIG;IACH,8BAHoB,YAAY,+BAK/B;IAED;;;;OAIG;IACH,oCAHoB,UAAU,+BAK7B;IAED;;;OAGG;IACH,YAFY,YAAY,EAAE,CAIzB;IAED;;;OAGG;IACH,kBAFY,UAAU,EAAE,CAIvB;IAED;;;;OAIG;IACH,cAHW,YAAY,GACV,OAAO,CAenB;IAED;;;;OAIG;IACH,qDAFa,YAAY,EAAE,CAqB1B;IAED;;;;OAIG;IACH,0DAFa,YAAY,EAAE,CAqB1B;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,YAAY,GAAC,SAAS,CAkBlC;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,YAAY,CAUxB;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,UAAU,GAAC,SAAS,CAgBhC;IAED;;;;;OAKG;IACH,+BAJW,MAAM,WACN,MAAM,GACJ,4BAA0B,SAAS,CAY/C;IAED;;;;OAIG;IACH,mCAFa,MAAM,CAclB;IAED;;;OAGG;IACH,cAFW,YAAY,QAgBtB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CA4BnB;IAED;;;;;;;;OAQG;IACH,uCANW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,MAAM,CAqClB;IAED;;;;;;;OAOG;IACH,6BANW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,MAAM,CAoDlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,OAAO,CAuBnB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,UACN,MAAM,EAAE,GACN,MAAM,CAyBlB;IAGL;;;OAGG;IACH,sBAFU,OAAO,CAEc;CAN9B;6BA1mB4B,wBAAwB;2BAD1B,iBAAiB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {assert} from "../../assert.js";
|
|
2
|
-
import {array_push_if_unique} from "../../collection/array/array_push_if_unique.js";
|
|
3
|
-
import {array_remove_first} from "../../collection/array/array_remove_first.js";
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
2
|
+
import { array_push_if_unique } from "../../collection/array/array_push_if_unique.js";
|
|
3
|
+
import { array_remove_first } from "../../collection/array/array_remove_first.js";
|
|
4
4
|
import List from "../../collection/list/List.js";
|
|
5
5
|
import IdPool from "../../IdPool.js";
|
|
6
|
-
import {Connection} from "./Connection.js";
|
|
7
|
-
import {NodeInstance} from "./node/NodeInstance.js";
|
|
8
|
-
import {PortDirection} from "./node/PortDirection.js";
|
|
6
|
+
import { Connection } from "./Connection.js";
|
|
7
|
+
import { NodeInstance } from "./node/NodeInstance.js";
|
|
8
|
+
import { PortDirection } from "./node/PortDirection.js";
|
|
9
9
|
|
|
10
10
|
export class NodeGraph {
|
|
11
11
|
|
|
@@ -131,7 +131,7 @@ export class NodeGraph {
|
|
|
131
131
|
* @param {Connection[]} [connections]
|
|
132
132
|
* @returns {{connections:Connection[], nodes:NodeInstance[]}} local created instances
|
|
133
133
|
*/
|
|
134
|
-
mergeFragment({nodes, connections = []}) {
|
|
134
|
+
mergeFragment({ nodes, connections = [] }) {
|
|
135
135
|
|
|
136
136
|
const previous_node_count = this.nodes.length;
|
|
137
137
|
const previous_connection_count = this.connections.length;
|
|
@@ -518,8 +518,6 @@ export class NodeGraph {
|
|
|
518
518
|
assert.isNonNegativeInteger(targetNode, 'targetNode');
|
|
519
519
|
assert.isNonNegativeInteger(targetPort, 'targetPort');
|
|
520
520
|
|
|
521
|
-
//TODO validate if connection already exists
|
|
522
|
-
|
|
523
521
|
const sourceNodeInstance = this.getNode(sourceNode);
|
|
524
522
|
|
|
525
523
|
if (sourceNodeInstance === undefined) {
|
|
@@ -536,13 +534,13 @@ export class NodeGraph {
|
|
|
536
534
|
const sourceEndpoint = sourceNodeInstance.getEndpoint(sourcePort);
|
|
537
535
|
|
|
538
536
|
if (sourceEndpoint === undefined) {
|
|
539
|
-
throw new Error(`Source port '${sourcePort}' not found`);
|
|
537
|
+
throw new Error(`Source port '${sourcePort}' not found on ${sourceNodeInstance}`);
|
|
540
538
|
}
|
|
541
539
|
|
|
542
540
|
const targetEndpoint = targetNodeInstance.getEndpoint(targetPort);
|
|
543
541
|
|
|
544
542
|
if (targetEndpoint === undefined) {
|
|
545
|
-
throw new Error(`Target port '${targetPort}' not found`);
|
|
543
|
+
throw new Error(`Target port '${targetPort}' not found on ${targetNodeInstance}`);
|
|
546
544
|
}
|
|
547
545
|
|
|
548
546
|
//create connection
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeDescription.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeDescription.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeDescription.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeDescription.js"],"names":[],"mappings":"AAwCA;IACI;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;;;;OAMG;IACH,IAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,iBAFU,IAAI,EAAE,CAEL;IAEX;;;OAGG;IACH,YAFU,wBAAwB,EAAE,CAEpB;IAEhB;;OAEG;IACH;QACI;;;WAGG;4BADO,OAAO,IAAI,CAAC;QAGtB;;;WAGG;8BADO,OAAO,IAAI,CAAC;MAGxB;IAEF;;;;OAIG;IACH,4CAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;OAGG;IACH,sBAEC;IAED;;;;;;OAMG;IACH,sBALW,MAAM,QACN,qBAAqB,iBACrB,MAAM,GAAC,OAAO,GAAC,MAAM,GACnB,MAAM,CA0ClB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,wBAAwB,CAiBpC;IAGD;;;;;;OAMG;IACH,oDAHW,aAAa,GACX,MAAM,CA2BlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CAuBnB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,IAAI,GAAC,IAAI,CAgBrB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACL,IAAI,EAAE,CAwBjB;IAED;;;;OAIG;IACH,+BAHW,aAAa,GACZ,IAAI,EAAE,CAuBjB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,aACN,aAAa,GACZ,IAAI,GAAC,SAAS,CAmBzB;IAED;;;OAGG;IACH,YAFa,IAAI,EAAE,CAIlB;IAED;;;;OAIG;IACH,cAHW,eAAe,GACb,OAAO,CAOnB;IAED,mBAEC;IAED;;;;MAMC;IAED;;;;;;OAMG;IACH;;;;qCAIC;IAKL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAR1C;;;;qBA/XoB,WAAW;yCADS,yCAAyC;mBAH/D,kCAAkC;sCAEf,sCAAsC;8BAG9C,oBAAoB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { assert } from "../../../assert.js";
|
|
2
|
+
import { BitSet } from "../../../binary/BitSet.js";
|
|
2
3
|
import { isArrayEqual } from "../../../collection/array/isArrayEqual.js";
|
|
3
4
|
import Signal from "../../../events/signal/Signal.js";
|
|
4
5
|
import { invokeObjectToJSON } from "../../object/invokeObjectToJSON.js";
|
|
@@ -9,28 +10,26 @@ import { PortDirection } from "./PortDirection.js";
|
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
|
-
* @template T
|
|
13
13
|
* @private
|
|
14
|
-
* @param {
|
|
14
|
+
* @param {{id:number}[]} things
|
|
15
15
|
* @returns {number}
|
|
16
16
|
*/
|
|
17
17
|
function pickNewSetId(things) {
|
|
18
18
|
|
|
19
|
+
const used = new BitSet();
|
|
19
20
|
|
|
20
21
|
const n = things.length;
|
|
21
22
|
|
|
22
|
-
let r = n;
|
|
23
|
-
|
|
24
23
|
for (let i = 0; i < n; i++) {
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const thing = things[i];
|
|
26
|
+
if (thing !== undefined) {
|
|
27
|
+
used.set(thing.id, true);
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
return
|
|
32
|
+
return used.nextClearBit(0);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
/**
|
|
@@ -185,6 +184,7 @@ export class NodeDescription {
|
|
|
185
184
|
* @param {DataType} type
|
|
186
185
|
* @param {String} name
|
|
187
186
|
* @param {PortDirection} direction
|
|
187
|
+
* @returns {number} ID of the newly created port
|
|
188
188
|
*/
|
|
189
189
|
createPort(type, name, direction) {
|
|
190
190
|
assert.defined(type, 'type');
|
|
@@ -237,6 +237,7 @@ export class NodeDescription {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
// port not found
|
|
240
241
|
return false;
|
|
241
242
|
}
|
|
242
243
|
|
|
@@ -57,9 +57,25 @@ test("delete port", () => {
|
|
|
57
57
|
expect(node.getPorts()).toEqual([]);
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
+
test("id uniqueness is preserved when ports are added and deleted out of order", () => {
|
|
61
|
+
|
|
62
|
+
const node = new NodeDescription();
|
|
63
|
+
|
|
64
|
+
const a = node.createPort(DUMMY_TYPE, "a", PortDirection.In);
|
|
65
|
+
const b = node.createPort(DUMMY_TYPE, "b", PortDirection.In);
|
|
66
|
+
const c = node.createPort(DUMMY_TYPE, "c", PortDirection.In);
|
|
67
|
+
|
|
68
|
+
node.deletePort(b);
|
|
69
|
+
|
|
70
|
+
const d = node.createPort(DUMMY_TYPE, "d", PortDirection.In);
|
|
71
|
+
|
|
72
|
+
expect(d).toEqual(b);
|
|
73
|
+
|
|
74
|
+
});
|
|
75
|
+
|
|
60
76
|
test("toString", () => {
|
|
61
77
|
const node = new NodeDescription();
|
|
62
78
|
|
|
63
79
|
expect(typeof node.toString()).toBe("string");
|
|
64
80
|
expect(node.toString().length).toBeGreaterThan(0);
|
|
65
|
-
});
|
|
81
|
+
});
|