pmcf 2.7.0 → 2.7.1
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/host.mjs +17 -12
- package/types/host.d.mts +1 -0
package/package.json
CHANGED
package/src/host.mjs
CHANGED
|
@@ -107,7 +107,7 @@ export class Host extends Base {
|
|
|
107
107
|
if (data.extends) {
|
|
108
108
|
this.finalize(() => {
|
|
109
109
|
for (const host of this.extends) {
|
|
110
|
-
if(host === this) {
|
|
110
|
+
if (host === this) {
|
|
111
111
|
this.error("Cant extend myself");
|
|
112
112
|
}
|
|
113
113
|
host.execFinalize();
|
|
@@ -637,11 +637,13 @@ export class NetworkInterface extends Base {
|
|
|
637
637
|
return this;
|
|
638
638
|
}
|
|
639
639
|
|
|
640
|
+
extendedProperty(name) {
|
|
641
|
+
return this.extends.find(i => i[name])?.[name];
|
|
642
|
+
}
|
|
643
|
+
|
|
640
644
|
get network() {
|
|
641
645
|
return (
|
|
642
|
-
this._network ??
|
|
643
|
-
this.extends.find(i => i.network)?.network ??
|
|
644
|
-
this.host.network
|
|
646
|
+
this._network ?? this.extendedProperty("_network") ?? this.host.network
|
|
645
647
|
);
|
|
646
648
|
}
|
|
647
649
|
|
|
@@ -656,7 +658,7 @@ export class NetworkInterface extends Base {
|
|
|
656
658
|
get scope() {
|
|
657
659
|
return (
|
|
658
660
|
this._scope ??
|
|
659
|
-
this.
|
|
661
|
+
this.extendedProperty("_scope") ??
|
|
660
662
|
this.network?.scope ??
|
|
661
663
|
"global"
|
|
662
664
|
);
|
|
@@ -667,7 +669,7 @@ export class NetworkInterface extends Base {
|
|
|
667
669
|
}
|
|
668
670
|
|
|
669
671
|
get hwaddr() {
|
|
670
|
-
return this._hwaddr ?? this.
|
|
672
|
+
return this._hwaddr ?? this.extendedProperty("_hwaddr");
|
|
671
673
|
}
|
|
672
674
|
|
|
673
675
|
set metric(value) {
|
|
@@ -675,7 +677,12 @@ export class NetworkInterface extends Base {
|
|
|
675
677
|
}
|
|
676
678
|
|
|
677
679
|
get metric() {
|
|
678
|
-
return
|
|
680
|
+
return (
|
|
681
|
+
this._metric ??
|
|
682
|
+
this.extendedProperty("_metric") ??
|
|
683
|
+
this.network?.metric ??
|
|
684
|
+
1004
|
|
685
|
+
);
|
|
679
686
|
}
|
|
680
687
|
|
|
681
688
|
set ssid(value) {
|
|
@@ -683,9 +690,7 @@ export class NetworkInterface extends Base {
|
|
|
683
690
|
}
|
|
684
691
|
|
|
685
692
|
get ssid() {
|
|
686
|
-
return (
|
|
687
|
-
this._ssid ?? this.extends.find(i => i.ssid)?.ssid ?? this.network?.ssid
|
|
688
|
-
);
|
|
693
|
+
return this._ssid ?? this.extendedProperty("_ssid") ?? this.network?.ssid;
|
|
689
694
|
}
|
|
690
695
|
|
|
691
696
|
set psk(value) {
|
|
@@ -693,7 +698,7 @@ export class NetworkInterface extends Base {
|
|
|
693
698
|
}
|
|
694
699
|
|
|
695
700
|
get psk() {
|
|
696
|
-
return this._psk ?? this.
|
|
701
|
+
return this._psk ?? this.extendedProperty("_psk") ?? this.network?.psk;
|
|
697
702
|
}
|
|
698
703
|
|
|
699
704
|
set kind(value) {
|
|
@@ -702,7 +707,7 @@ export class NetworkInterface extends Base {
|
|
|
702
707
|
|
|
703
708
|
get kind() {
|
|
704
709
|
return (
|
|
705
|
-
this._kind ?? this.
|
|
710
|
+
this._kind ?? this.extendedProperty("_kind") ?? this.network?.kind
|
|
706
711
|
);
|
|
707
712
|
}
|
|
708
713
|
}
|
package/types/host.d.mts
CHANGED