pmcf 6.16.1 → 6.16.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/bin/pmcf-diagram CHANGED
@@ -32,7 +32,7 @@ for await (const network of location.networks) {
32
32
  .join(" ")}" shape=circle];`
33
33
  );
34
34
 
35
- for await (const na of network.networkAddresses(
35
+ for (const na of network.networkAddresses(
36
36
  na =>
37
37
  na.networkInterface.network === network &&
38
38
  !na.networkInterface.isTemplate &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.16.1",
3
+ "version": "6.16.3",
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) {
@@ -356,7 +356,7 @@ export class kea extends CoreService {
356
356
  const hwmap = new Map();
357
357
  const hostNames = new Set();
358
358
 
359
- for await (const { networkInterface } of source.networkAddresses()) {
359
+ for (const { networkInterface } of source.networkAddresses()) {
360
360
  if (networkInterface.hwaddr) {
361
361
  if (!hostNames.has(networkInterface.hostName)) {
362
362
  hwmap.set(networkInterface.hwaddr, networkInterface);
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() {