pmcf 6.10.1 → 6.10.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.10.1",
3
+ "version": "6.10.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -52,7 +52,7 @@
52
52
  "dependencies": {
53
53
  "aggregated-map": "^1.0.7",
54
54
  "content-entry-transform": "^1.6.9",
55
- "ip-utilties": "^3.7.1",
55
+ "ip-utilties": "^3.7.4",
56
56
  "npm-pkgbuild": "^20.8.2",
57
57
  "pacc": "^10.4.1",
58
58
  "package-directory": "^8.2.0",
package/src/base.mjs CHANGED
@@ -516,7 +516,7 @@ export class Base {
516
516
 
517
517
  try {
518
518
  if ((await stat(dir)).isDirectory) {
519
- console.log("TD", dir);
519
+ //console.log("TD", dir);
520
520
  yield transform(
521
521
  new FileContentProvider(
522
522
  { dir, pattern: "**/*" },
@@ -372,11 +372,7 @@ class bind_group extends Base {
372
372
  content.push(` type ${config.type};`);
373
373
  content.push(` file \"${zone.file}\";`);
374
374
  content.push(
375
- ` allow-update { ${
376
- this.allowedUpdates.length
377
- ? this.allowedUpdates.join(";")
378
- : "none"
379
- }; };`
375
+ addressesStatement(" allow-update", this.allowedUpdates, "none;")
380
376
  );
381
377
  content.push(` notify ${yesno(this.notify)};`);
382
378
  }
@@ -407,13 +403,19 @@ class bind_group extends Base {
407
403
  }
408
404
  }
409
405
 
410
- function addressesStatement(prefix, objects, generateEmpty = false) {
411
- const body = asArray(objects).map(name => ` ${name};`);
406
+ function addressesStatement(prefix, objects, empty = false) {
407
+ const body = asArray(objects).map(
408
+ value => ` ${typeof value === "string" ? value : value.name};`
409
+ );
412
410
 
413
- if (body.length || generateEmpty) {
411
+ if (body.length) {
414
412
  return [`${prefix} {`, body, "};"];
415
413
  }
416
414
 
415
+ if (empty) {
416
+ return [`${prefix} {`, empty, "};"];
417
+ }
418
+
417
419
  return [];
418
420
  }
419
421
 
package/src/subnet.mjs CHANGED
@@ -2,7 +2,6 @@ import {
2
2
  normalizeCIDR,
3
3
  rangeIP,
4
4
  decodeIP,
5
- familyIP,
6
5
  matchPrefixIP,
7
6
  FAMILY_IPV6
8
7
  } from "ip-utilties";
@@ -35,13 +34,13 @@ export class Subnet {
35
34
  networks = new Set();
36
35
 
37
36
  constructor(address) {
38
- const { longPrefix, prefix, prefixLength, cidr } = normalizeCIDR(address);
37
+ const { longPrefix, prefix, prefixLength, cidr, family } = normalizeCIDR(address);
39
38
 
40
39
  this.address = cidr;
41
40
  this.prefix = prefix;
42
41
  this.prefixLength = prefixLength;
43
42
  this.longPrefix = longPrefix;
44
- this.family = familyIP(address);
43
+ this.family = family;
45
44
  }
46
45
 
47
46
  get owner() {