pacc 4.13.0 → 4.13.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 +5 -0
- package/package.json +1 -1
- package/src/properties.mjs +15 -12
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
|
|
|
44
44
|
* [default\_attribute\_writable](#default_attribute_writable-3)
|
|
45
45
|
* [string\_collection\_attribute\_writable](#string_collection_attribute_writable)
|
|
46
46
|
* [name\_attribute](#name_attribute)
|
|
47
|
+
* [name\_attribute\_writable](#name_attribute_writable)
|
|
47
48
|
* [email\_attribute](#email_attribute)
|
|
48
49
|
* [version\_attribute\_writable](#version_attribute_writable)
|
|
49
50
|
* [description\_attribute](#description_attribute)
|
|
@@ -216,6 +217,10 @@ Type: [AttributeDefinition](#attributedefinition)
|
|
|
216
217
|
|
|
217
218
|
Type: [AttributeDefinition](#attributedefinition)
|
|
218
219
|
|
|
220
|
+
## name\_attribute\_writable
|
|
221
|
+
|
|
222
|
+
Type: [AttributeDefinition](#attributedefinition)
|
|
223
|
+
|
|
219
224
|
## email\_attribute
|
|
220
225
|
|
|
221
226
|
Type: [AttributeDefinition](#attributedefinition)
|
package/package.json
CHANGED
package/src/properties.mjs
CHANGED
|
@@ -15,22 +15,25 @@ export function definePropertiesFromAttributes(
|
|
|
15
15
|
|
|
16
16
|
let value = getAttribute(values, name, attribute) ?? values?.[name];
|
|
17
17
|
|
|
18
|
-
if (value !== undefined
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
if (value !== undefined) {
|
|
19
|
+
if (path.length === 1) {
|
|
20
|
+
const op = Object.getOwnPropertyDescriptor(
|
|
21
|
+
object.constructor.prototype,
|
|
22
|
+
name
|
|
23
|
+
);
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
const property = properties[name];
|
|
25
|
+
value = convertValue(value, attribute);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const property = properties[name];
|
|
28
|
+
|
|
29
|
+
if (op?.set || property?.set) {
|
|
30
|
+
applyLater[name] = value;
|
|
31
|
+
} else {
|
|
32
|
+
properties[name] = Object.assign({ ...attribute, value }, property);
|
|
33
|
+
}
|
|
29
34
|
} else {
|
|
30
|
-
|
|
35
|
+
setAttribute(object, name, value, attribute);
|
|
31
36
|
}
|
|
32
|
-
} else {
|
|
33
|
-
setAttribute(object, name, value, attribute);
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
|