pacc 4.12.2 → 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.12.2",
3
+ "version": "4.13.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -67,6 +67,14 @@ export const name_attribute = {
67
67
  isKey: true
68
68
  };
69
69
 
70
+ /**
71
+ * @type {AttributeDefinition}
72
+ */
73
+ export const name_attribute_writable = {
74
+ ...name_attribute,
75
+ writable: true
76
+ };
77
+
70
78
  /**
71
79
  * @type {AttributeDefinition}
72
80
  */
@@ -176,7 +184,6 @@ export { secret_attribute as username_attribute };
176
184
  */
177
185
  export { secret_attribute as password_attribute };
178
186
 
179
-
180
187
  /**
181
188
  * @type {AttributeDefinition}
182
189
  */
@@ -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
 
@@ -47,6 +47,10 @@ export const string_collection_attribute_writable: AttributeDefinition;
47
47
  * @type {AttributeDefinition}
48
48
  */
49
49
  export const name_attribute: AttributeDefinition;
50
+ /**
51
+ * @type {AttributeDefinition}
52
+ */
53
+ export const name_attribute_writable: AttributeDefinition;
50
54
  /**
51
55
  * @type {AttributeDefinition}
52
56
  */