pmcf 2.19.6 → 2.20.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/README.md CHANGED
@@ -18,7 +18,31 @@
18
18
 
19
19
  <!-- Generated by documentation.js. Update this documentation by updating the source code. -->
20
20
 
21
- ## Table of Contents
21
+ ### Table of Contents
22
+
23
+ * [NetworkAddress](#networkaddress)
24
+ * [Properties](#properties)
25
+ * [networkAddresses](#networkaddresses)
26
+ * [Parameters](#parameters)
27
+
28
+ ## NetworkAddress
29
+
30
+ Type: [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
31
+
32
+ ### Properties
33
+
34
+ * `networkInterface` **NetworkInterface**&#x20;
35
+ * `address` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [Uint16Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array))**&#x20;
36
+ * `subnet` **Subnet**&#x20;
37
+ * `domainNames` **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
38
+
39
+ ## networkAddresses
40
+
41
+ ### Parameters
42
+
43
+ * `filter` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
44
+
45
+ Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
22
46
 
23
47
  # install
24
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.19.6",
3
+ "version": "2.20.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,7 +38,7 @@
38
38
  "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
39
39
  },
40
40
  "dependencies": {
41
- "ip-utilties": "^1.1.0",
41
+ "ip-utilties": "^1.1.1",
42
42
  "npm-pkgbuild": "^18.0.1",
43
43
  "pacc": "^3.4.0",
44
44
  "pkg-dir": "^8.0.0"
@@ -76,14 +76,18 @@ class SkeletonNetworkInterface extends Base {
76
76
  * @param {object} filter
77
77
  * @return {Iterable<NetworkAddress>}
78
78
  */
79
- *networkAddresses(filter) {
79
+ *networkAddresses(filter=(n)=>true) {
80
80
  for (const [address, subnet] of this.ipAddresses) {
81
- yield {
81
+ const networkAddress = {
82
82
  networkInterface: this,
83
83
  domainNames: this.domainNames,
84
84
  address,
85
85
  subnet
86
86
  };
87
+
88
+ if(filter(networkAddress)) {
89
+ yield networkAddress;
90
+ }
87
91
  }
88
92
  }
89
93
 
@@ -714,7 +714,7 @@ declare class SkeletonNetworkInterface extends Base {
714
714
  * @param {object} filter
715
715
  * @return {Iterable<NetworkAddress>}
716
716
  */
717
- networkAddresses(filter: object): Iterable<NetworkAddress>;
717
+ networkAddresses(filter?: object): Iterable<NetworkAddress>;
718
718
  get rawAddress(): any;
719
719
  get rawIPv4Address(): any;
720
720
  get rawIPv6Address(): any;