pmcf 6.32.2 → 6.32.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.32.2",
3
+ "version": "6.32.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -191,16 +191,7 @@ class bind_zone_config extends Base {
191
191
  );
192
192
  break;
193
193
  case "secondary":
194
- const primaries = [...this.service.primaries]
195
- .map(e => e.endpoints())
196
- .flat()
197
- .filter(
198
- e =>
199
- e.networkAddress &&
200
- addressType(e.networkAddress.address) !==
201
- ADDRESS_TYPE_LOOPBACK
202
- )
203
- .map(e => e.networkAddress.address);
194
+ const primaries = endpointAddresses(this.service.primaries);
204
195
 
205
196
  content.push(
206
197
  ...addressesStatement(" primaries", primaries, false, " ")
@@ -649,6 +640,29 @@ class bind_group extends bind_object {
649
640
  }
650
641
  }
651
642
 
643
+ function endpointAddresses(entries) {
644
+ if (entries === undefined) {
645
+ return [];
646
+ }
647
+
648
+ /*
649
+ [...this.forwarders]
650
+ .map(e => e.endpoints())
651
+ .flat()
652
+ .filter(e => e.networkAddress)
653
+ .map(e => e.networkAddress?.address);
654
+ */
655
+ return [...entries]
656
+ .map(e => e.endpoints())
657
+ .flat()
658
+ .filter(
659
+ e =>
660
+ e.networkAddress &&
661
+ addressType(e.networkAddress.address) !== ADDRESS_TYPE_LOOPBACK
662
+ )
663
+ .map(e => e.networkAddress.address);
664
+ }
665
+
652
666
  /**
653
667
  *
654
668
  * @param {string} prefix
@@ -784,17 +798,13 @@ export class bind extends CoreService {
784
798
  async writeForwarders(outputControl) {
785
799
  // TODO formulate everything as pacc expression
786
800
 
787
- /*
801
+ /*
788
802
  console.log("F",this.extends);
789
803
  console.log("F0",this.fullName);
790
804
  console.log("F1",this.forwarders);
791
805
  */
792
- const forwarders = [...this.forwarders]
793
- .map(e => e.endpoints())
794
- .flat()
795
- .filter(e => e.networkAddress)
796
- .map(e => e.networkAddress?.address);
797
-
806
+ const forwarders = endpointAddresses(this.forwarders);
807
+
798
808
  if (forwarders.length) {
799
809
  await writeLines(
800
810
  join(outputControl.dir, "etc/named/options"),