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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacc",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -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 && path.length === 1) {
19
- const op = Object.getOwnPropertyDescriptor(
20
- object.constructor.prototype,
21
- name
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
- value = convertValue(value, attribute);
25
- const property = properties[name];
25
+ value = convertValue(value, attribute);
26
26
 
27
- if (op?.set || property?.set) {
28
- applyLater[name] = value;
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
- properties[name] = Object.assign({ ...attribute, value }, property);
35
+ setAttribute(object, name, value, attribute);
31
36
  }
32
- } else {
33
- setAttribute(object, name, value, attribute);
34
37
  }
35
38
  }
36
39