pmcf 6.39.0 → 6.39.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
@@ -117,7 +117,7 @@ generates config packages for:
117
117
 
118
118
  ## Base
119
119
 
120
- **Extends Core**
120
+ **Extends core**
121
121
 
122
122
  attributes: as declared in the types
123
123
  properties: use defined values to support attribute value definitions
@@ -214,7 +214,7 @@ Walk the object graph in some directions and deliver seen nodes.
214
214
 
215
215
  * `directions` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** (optional, default `["this","extends","owner"]`)
216
216
 
217
- Returns **Iterable\<Core>**&#x20;
217
+ Returns **Iterable\<core>**&#x20;
218
218
 
219
219
  ## mapFromDirections
220
220
 
package/bin/pmcf-info CHANGED
@@ -112,25 +112,32 @@ function show(value, indent, options) {
112
112
  }
113
113
  }
114
114
  } else {
115
- try {
116
- const l = [...v];
117
-
118
- if (l.length > 1) {
119
- console.log(name(attribute));
120
-
121
- if (l.length >= options.maxEntries) {
122
- l[options.maxEntries] = { fullName: "..." };
123
- l.length = options.maxEntries + 1;
124
- }
125
-
126
- for (const o of l) {
127
- console.log(prefix(indent + 2) + o.fullName);
115
+ if (typeof v.get === "function") {
116
+ console.log(name(attribute));
117
+ for(const [k,o] of v) {
118
+ show(o,indent + 2, options);
119
+ }
120
+ } else {
121
+ try {
122
+ const l = [...v];
123
+
124
+ if (l.length > 1) {
125
+ console.log(name(attribute));
126
+
127
+ if (l.length >= options.maxEntries) {
128
+ l[options.maxEntries] = { fullName: "..." };
129
+ l.length = options.maxEntries + 1;
130
+ }
131
+
132
+ for (const o of l) {
133
+ console.log(prefix(indent + 2) + o.fullName);
134
+ }
135
+ } else if (l.length === 1) {
136
+ console.log(name(attribute) + l[0].fullName);
128
137
  }
129
- } else if (l.length === 1) {
130
- console.log(name(attribute) + l[0].fullName);
138
+ } catch (e) {
139
+ console.log(name(attribute), v);
131
140
  }
132
- } catch (e) {
133
- console.log(name(attribute), v);
134
141
  }
135
142
  }
136
143
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.39.0",
3
+ "version": "6.39.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -100,10 +100,6 @@ export class Base extends core {
100
100
  }
101
101
  }
102
102
 
103
- get root() {
104
- return this.owner?.root;
105
- }
106
-
107
103
  get host() {
108
104
  return this.owner?.host;
109
105
  }
package/src/content.mjs CHANGED
@@ -11,6 +11,7 @@ import { loadHooks } from "./hooks.mjs";
11
11
 
12
12
  export class permission extends core {
13
13
  static priority = 1.9;
14
+ static key = "pattern";
14
15
  static attributes = {
15
16
  pattern: { ...string_attribute_writable, key: true, name: "pattern" },
16
17
  user: { ...string_attribute_writable, name: "user" },
@@ -22,7 +23,7 @@ export class permission extends core {
22
23
  addType(this);
23
24
  }
24
25
 
25
- get name() {
26
+ get fullName() {
26
27
  return this.pattern;
27
28
  }
28
29
  }
@@ -84,6 +85,10 @@ export class content extends core {
84
85
  this._name = value;
85
86
  }
86
87
 
88
+ get fullName() {
89
+ return this.name;
90
+ }
91
+
87
92
  /**
88
93
  * @return {string}
89
94
  */
package/src/core.mjs CHANGED
@@ -321,4 +321,8 @@ export class core {
321
321
  get isTemplate() {
322
322
  return false;
323
323
  }
324
+
325
+ get root() {
326
+ return this.owner?.root;
327
+ }
324
328
  }
@@ -6,7 +6,7 @@ import {
6
6
  resolveTypeLinks,
7
7
  create
8
8
  } from "pacc";
9
- import { Base, root, assign } from "pmcf";
9
+ import { core, root, assign } from "pmcf";
10
10
 
11
11
  /**
12
12
  * Keeps track of all in flight object creations and loose ends during config initialization.
@@ -122,7 +122,7 @@ export class InitializationContext {
122
122
  this.instantiateAndAssign(object, attribute, v);
123
123
  }
124
124
  } else {
125
- if (value instanceof Base) {
125
+ if (value instanceof core) {
126
126
  assign(attribute, object, value);
127
127
  } else {
128
128
  for (const [objectName, objectData] of Object.entries(value)) {