pmcf 6.17.2 → 6.17.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/bin/pmcf-info +10 -2
- package/package.json +4 -4
- package/src/base.mjs +6 -3
- package/src/network-address.mjs +26 -2
- package/src/type.mjs +6 -1
package/bin/pmcf-info
CHANGED
|
@@ -5,13 +5,21 @@ import { prepare } from "../src/cli.mjs";
|
|
|
5
5
|
const { root, args, options } = await prepare({});
|
|
6
6
|
|
|
7
7
|
for (const expression of args) {
|
|
8
|
-
const result = root.
|
|
8
|
+
const result = root.expression(expression);
|
|
9
9
|
|
|
10
10
|
show(result);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
function show(value, indent = 0, short = false) {
|
|
14
|
-
|
|
14
|
+
switch (typeof value) {
|
|
15
|
+
case "string":
|
|
16
|
+
case "number":
|
|
17
|
+
case "bigint":
|
|
18
|
+
console.log(value);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (value instanceof Iterator || Array.isArray(value)) {
|
|
15
23
|
for (const v of value) {
|
|
16
24
|
show(v, indent);
|
|
17
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "6.17.
|
|
3
|
+
"version": "6.17.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"aggregated-map": "^1.0.8",
|
|
54
54
|
"content-entry-transform": "^1.7.0",
|
|
55
55
|
"ip-utilties": "^3.9.0",
|
|
56
|
-
"npm-pkgbuild": "^20.8.
|
|
57
|
-
"pacc": "^
|
|
56
|
+
"npm-pkgbuild": "^20.8.7",
|
|
57
|
+
"pacc": "^11.0.0",
|
|
58
58
|
"package-directory": "^8.2.0",
|
|
59
59
|
"yaml": "^2.9.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@types/node": "^26.1.
|
|
62
|
+
"@types/node": "^26.1.2",
|
|
63
63
|
"ava": "^8.0.1",
|
|
64
64
|
"c8": "^12.0.0",
|
|
65
65
|
"documentation": "^14.0.3",
|
package/src/base.mjs
CHANGED
|
@@ -399,7 +399,8 @@ export class Base {
|
|
|
399
399
|
*/
|
|
400
400
|
expression(expression, options) {
|
|
401
401
|
return parse(expression, {
|
|
402
|
-
root: this,
|
|
402
|
+
root: this.root,
|
|
403
|
+
current: this,
|
|
403
404
|
valueFor: (name, at) =>
|
|
404
405
|
at === undefined ? globals[name] : at.value(name),
|
|
405
406
|
...options
|
|
@@ -496,7 +497,8 @@ export class Base {
|
|
|
496
497
|
e => e.isBlob,
|
|
497
498
|
expression =>
|
|
498
499
|
parse(expression, {
|
|
499
|
-
root: this,
|
|
500
|
+
root: this.root,
|
|
501
|
+
current: this,
|
|
500
502
|
valueFor: (name, at) =>
|
|
501
503
|
at === undefined ? globals[name] : at.value(name)
|
|
502
504
|
})
|
|
@@ -565,7 +567,8 @@ export class Base {
|
|
|
565
567
|
|
|
566
568
|
return expand(object, {
|
|
567
569
|
stopClass: Base,
|
|
568
|
-
root: this,
|
|
570
|
+
root: this.root,
|
|
571
|
+
current: this,
|
|
569
572
|
valueFor: (name, at) =>
|
|
570
573
|
at === undefined ? globals[name] : at.value(name)
|
|
571
574
|
});
|
package/src/network-address.mjs
CHANGED
|
@@ -1,13 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
default_attribute,
|
|
3
|
+
string_attribute,
|
|
4
|
+
name_attribute,
|
|
5
|
+
getAttribute
|
|
6
|
+
} from "pacc";
|
|
7
|
+
|
|
2
8
|
import { familyIP, formatCIDR, decodeIP } from "ip-utilties";
|
|
3
9
|
import { Subnet } from "./subnet.mjs";
|
|
4
|
-
import { Owner } from "pmcf";
|
|
10
|
+
import { Owner, addType } from "pmcf";
|
|
5
11
|
import { NetworkInterface } from "./network-interfaces/network-interface.mjs";
|
|
6
12
|
|
|
7
13
|
/**
|
|
8
14
|
*
|
|
9
15
|
*/
|
|
10
16
|
export class NetworkAddress {
|
|
17
|
+
static name = "network-address";
|
|
18
|
+
static priority = 1;
|
|
19
|
+
static key = "address";
|
|
20
|
+
static attributes = {
|
|
21
|
+
address: { ...name_attribute, name: "address" },
|
|
22
|
+
cidrAddress: { ...string_attribute, name: "cidrAddress" },
|
|
23
|
+
networkInterface: {
|
|
24
|
+
...default_attribute,
|
|
25
|
+
name: "networkInterface",
|
|
26
|
+
type: "network_interface"
|
|
27
|
+
},
|
|
28
|
+
family: { ...string_attribute, name: "family" }
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
static {
|
|
32
|
+
addType(this);
|
|
33
|
+
}
|
|
34
|
+
|
|
11
35
|
/** @type {Subnet} */ subnet;
|
|
12
36
|
/** @type {NetworkInterface} */ networkInterface;
|
|
13
37
|
/** @type {string|Uint8Array|Uint16Array} */ address;
|
package/src/type.mjs
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { addType as addTypeBasic, toInternal } from "pacc";
|
|
1
|
+
import { addType as addTypeBasic, toInternal, registerToken, DOT } from "pacc";
|
|
2
2
|
import { normalizeIP } from "ip-utilties";
|
|
3
3
|
import { addServiceType } from "pmcf";
|
|
4
4
|
import { asArray } from "./utils.mjs";
|
|
5
5
|
|
|
6
|
+
|
|
7
|
+
const SLASH = {...DOT, str: "/" };
|
|
8
|
+
|
|
9
|
+
registerToken(SLASH);
|
|
10
|
+
|
|
6
11
|
addTypeBasic({
|
|
7
12
|
name: "ip",
|
|
8
13
|
primitive: true,
|