pmcf 6.54.7 → 6.55.0

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.54.7",
3
+ "version": "6.55.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  } from "content-entry-transform";
7
7
  import { FileContentProvider } from "npm-pkgbuild";
8
8
  import {
9
+ asArray,
9
10
  parse,
10
11
  globals,
11
12
  extract,
@@ -19,7 +20,8 @@ import {
19
20
  default_attribute_writable
20
21
  } from "pacc";
21
22
  import { union } from "./utils.mjs";
22
- import { addType, core } from "pmcf";
23
+ import { addType } from "./type.mjs";
24
+ import { core } from "./core.mjs";
23
25
  import { owner_attribute, aliases_attribute } from "./common-attributes.mjs";
24
26
 
25
27
  /**
@@ -262,13 +264,16 @@ export class base extends core {
262
264
  return [
263
265
  createExpressionTransformer(
264
266
  e => e.isBlob,
265
- expression =>
266
- parse(expression, {
267
+ expression => {
268
+ const result = parse(expression, {
267
269
  root: this.root,
268
270
  current: this,
269
271
  valueFor: (name, at) =>
270
272
  typeof at?.value === "function" ? at.value(name) : globals[name]
271
- })
273
+ });
274
+
275
+ return typeof result === "string" ? result : asArray(result).join("");
276
+ }
272
277
  )
273
278
  ];
274
279
  }
@@ -25,6 +25,7 @@ import { FAMILY_UNIX, FAMILY_DNS } from "./constants.mjs";
25
25
  import {
26
26
  networkAddressAttributes,
27
27
  extends_attribute,
28
+ networkInterfaces_attribute,
28
29
  endpointAttributes
29
30
  } from "./common-attributes.mjs";
30
31
  import {
@@ -65,6 +66,8 @@ export class CoreService extends base {
65
66
  }
66
67
  static attributes = {
67
68
  ...networkAddressAttributes,
69
+ // networkInterfaces: networkInterfaces_attribute,
70
+
68
71
  ...endpointAttributes,
69
72
  extends: {
70
73
  ...extends_attribute,
@@ -120,6 +123,10 @@ export class CoreService extends base {
120
123
  return this.owner.networkAddresses(filter);
121
124
  }
122
125
 
126
+ get networkInterfaces() {
127
+ return this.owner?.networkInterfaces;
128
+ }
129
+
123
130
  get subnets() {
124
131
  return this.owner.subnets;
125
132
  }
@@ -100,6 +100,10 @@ export class NetworkInterface extends SkeletonNetworkInterface {
100
100
  return new Set([this.network]);
101
101
  }
102
102
 
103
+ get networkInterfaces() {
104
+ return new Map([this.name, this]);
105
+ }
106
+
103
107
  get gateway() {
104
108
  return this.network?.gateway;
105
109
  }