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 +2 -2
- package/bin/pmcf-info +24 -17
- package/package.json +1 -1
- package/src/base.mjs +0 -4
- package/src/content.mjs +6 -1
- package/src/core.mjs +4 -0
- package/src/initialization-context.mjs +2 -2
package/README.md
CHANGED
|
@@ -117,7 +117,7 @@ generates config packages for:
|
|
|
117
117
|
|
|
118
118
|
## Base
|
|
119
119
|
|
|
120
|
-
**Extends
|
|
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\<
|
|
217
|
+
Returns **Iterable\<core>** 
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
}
|
|
130
|
-
console.log(name(attribute)
|
|
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
package/src/base.mjs
CHANGED
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
|
|
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
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
resolveTypeLinks,
|
|
7
7
|
create
|
|
8
8
|
} from "pacc";
|
|
9
|
-
import {
|
|
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
|
|
125
|
+
if (value instanceof core) {
|
|
126
126
|
assign(attribute, object, value);
|
|
127
127
|
} else {
|
|
128
128
|
for (const [objectName, objectData] of Object.entries(value)) {
|