pmcf 1.6.3 → 1.7.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/package.json +1 -1
- package/src/model.mjs +10 -6
package/package.json
CHANGED
package/src/model.mjs
CHANGED
|
@@ -168,7 +168,7 @@ export class Owner extends Base {
|
|
|
168
168
|
this.#bridges.add(bridge);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
for (const name of destinationNetworks) {
|
|
171
|
+
for (const name of asArray(destinationNetworks)) {
|
|
172
172
|
bridge.add(this.network(name) || name);
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -409,10 +409,10 @@ export class Network extends Owner {
|
|
|
409
409
|
constructor(owner, data) {
|
|
410
410
|
super(owner, data);
|
|
411
411
|
|
|
412
|
-
let
|
|
413
|
-
if (data.
|
|
414
|
-
|
|
415
|
-
delete data.
|
|
412
|
+
let bridge;
|
|
413
|
+
if (data.bridge) {
|
|
414
|
+
bridge = data.bridge;
|
|
415
|
+
delete data.bridge;
|
|
416
416
|
}
|
|
417
417
|
|
|
418
418
|
Object.assign(this, data);
|
|
@@ -431,7 +431,7 @@ export class Network extends Owner {
|
|
|
431
431
|
|
|
432
432
|
owner.addNetwork(this);
|
|
433
433
|
|
|
434
|
-
this.bridge = owner.addBridge(this,
|
|
434
|
+
this.bridge = owner.addBridge(this, bridge);
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
get ipv4_netmask() {
|
|
@@ -842,3 +842,7 @@ function extractFrom(object, propertyNames) {
|
|
|
842
842
|
function bridgeToJSON(bridge) {
|
|
843
843
|
return [...bridge].map(n => n.name || `(${n})`).sort();
|
|
844
844
|
}
|
|
845
|
+
|
|
846
|
+
function asArray(value) {
|
|
847
|
+
return Array.isArray(value) ? value : value === undefined ? [] : [value];
|
|
848
|
+
}
|