pmcf 6.16.2 → 6.16.4

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.16.2",
3
+ "version": "6.16.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,3 +1,4 @@
1
+ import { getAttribute } from "pacc";
1
2
  import { familyIP, formatCIDR, decodeIP } from "ip-utilties";
2
3
  import { Subnet } from "./subnet.mjs";
3
4
  import { Owner } from "pmcf";
@@ -12,10 +13,10 @@ export class NetworkAddress {
12
13
  /** @type {string|Uint8Array|Uint16Array} */ address;
13
14
 
14
15
  /**
15
- *
16
- * @param {NetworkInterface} networkInterface
17
- * @param {string|Uint8Array|Uint16Array} address
18
- * @param {Subnet} subnet
16
+ *
17
+ * @param {NetworkInterface} networkInterface
18
+ * @param {string|Uint8Array|Uint16Array} address
19
+ * @param {Subnet} subnet
19
20
  */
20
21
  constructor(networkInterface, address, subnet) {
21
22
  this.networkInterface = networkInterface;
@@ -38,6 +39,14 @@ export class NetworkAddress {
38
39
  toString() {
39
40
  return `${this.networkInterface.fullName} ${decodeIP(this.address)}`;
40
41
  }
42
+
43
+ attribute(name) {
44
+ return getAttribute(this, name);
45
+ }
46
+
47
+ value(name) {
48
+ return this.attribute(name);
49
+ }
41
50
  }
42
51
 
43
52
  /**
@@ -69,12 +78,12 @@ export function addresses(sources, options) {
69
78
  typeof object === "string" ? object : decodeIP(object.address)
70
79
  )
71
80
  )
72
- ].filter(e=>e!=='');
81
+ ].filter(e => e !== "");
73
82
  }
74
83
 
75
84
  /**
76
- *
77
- * @param {Array<NetworkAddress>} networkAddresses
85
+ *
86
+ * @param {Array<NetworkAddress>} networkAddresses
78
87
  * @returns {Array<string>}
79
88
  */
80
89
  export function cidrAddresses(networkAddresses) {
@@ -58,6 +58,14 @@ class zone extends Base {
58
58
 
59
59
  records = new Set();
60
60
 
61
+ get name() {
62
+ return this.id;
63
+ }
64
+
65
+ get fullName() {
66
+ return this.id;
67
+ }
68
+
61
69
  get domain() {
62
70
  return this.id;
63
71
  }
@@ -239,7 +247,7 @@ class bind_group extends Base {
239
247
  domainNames,
240
248
  family
241
249
  } of source.networkAddresses()) {
242
- // console.log(address);
250
+ // console.log(address);
243
251
  }
244
252
  }
245
253
  }
package/src/subnet.mjs CHANGED
@@ -58,6 +58,10 @@ export class Subnet {
58
58
  return getAttribute(this, name);
59
59
  }
60
60
 
61
+ value(name) {
62
+ return this.attribute(name);
63
+ }
64
+
61
65
  *_walkDirections(directions, seen) {}
62
66
 
63
67
  get cidr() {