pacc 4.41.0 → 4.41.2
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 +4 -4
- package/src/expression.mjs +1 -1
- package/src/types.mjs +18 -7
- package/types/types.d.mts +1 -0
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pacc",
|
|
3
|
-
"version": "4.41.
|
|
3
|
+
"version": "4.41.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
7
7
|
},
|
|
8
|
-
"packageManager": "npm@11.6.
|
|
8
|
+
"packageManager": "npm@11.6.3+sha512.4085a763162e0e3acd19a4e9d23ad3aa0978e501ccf947dd7233c12a689ae0bb0190763c4ef12366990056b34eec438903ffed38fde4fbd722a17c2a7407ee92",
|
|
9
9
|
"types": "./types/module.d.mts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"browser-ava": "^2.3.44",
|
|
43
43
|
"c8": "^10.1.3",
|
|
44
44
|
"documentation": "^14.0.3",
|
|
45
|
-
"semantic-release": "^25.0.
|
|
45
|
+
"semantic-release": "^25.0.2",
|
|
46
46
|
"typescript": "^5.9.3"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
49
|
+
"node": ">=24.11.1"
|
|
50
50
|
},
|
|
51
51
|
"repository": {
|
|
52
52
|
"type": "git",
|
package/src/expression.mjs
CHANGED
package/src/types.mjs
CHANGED
|
@@ -29,7 +29,8 @@ export const types = {
|
|
|
29
29
|
duration: {
|
|
30
30
|
name: "duration",
|
|
31
31
|
primitive: true,
|
|
32
|
-
prepareValue: value =>
|
|
32
|
+
prepareValue: value =>
|
|
33
|
+
typeof value === "string" ? parseFloat(value) : value
|
|
33
34
|
},
|
|
34
35
|
url: { name: "url", primitive: true },
|
|
35
36
|
object: { name: "object" }
|
|
@@ -89,12 +90,6 @@ export function addType(type) {
|
|
|
89
90
|
types[type.name] = type;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
for (const [path, attribute] of attributeIterator(type.attributes)) {
|
|
93
|
-
if (typeof attribute.type === "string") {
|
|
94
|
-
attribute.type = oneOfType(attribute.type);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
93
|
if (types[type.name] !== type) {
|
|
99
94
|
return Object.assign(types[type.name], type);
|
|
100
95
|
}
|
|
@@ -143,5 +138,21 @@ export function resolveTypeLinks() {
|
|
|
143
138
|
if (type.owners) {
|
|
144
139
|
type.owners = type.owners.map(owner => raiseOnUnknownType(owner, type));
|
|
145
140
|
}
|
|
141
|
+
|
|
142
|
+
for (const [path, attribute] of attributeIterator(type.attributes)) {
|
|
143
|
+
if (typeof attribute.type === "string") {
|
|
144
|
+
attribute.type = oneOfType(attribute.type);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
146
147
|
}
|
|
147
148
|
}
|
|
149
|
+
|
|
150
|
+
export function typeFactory(type, owner, data) {
|
|
151
|
+
const factory = type.factoryFor?.(owner, data) || type.clazz;
|
|
152
|
+
//console.log(factory, type, owner, data);
|
|
153
|
+
const object = new factory(owner);
|
|
154
|
+
|
|
155
|
+
object.read(data);
|
|
156
|
+
owner.addObject(object);
|
|
157
|
+
return object;
|
|
158
|
+
}
|
package/types/types.d.mts
CHANGED