pacc 3.1.1 → 3.1.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/README.md CHANGED
@@ -29,14 +29,16 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
29
29
 
30
30
  * [AttributeDefinition](#attributedefinition)
31
31
  * [Properties](#properties)
32
+ * [Token](#token)
33
+ * [Properties](#properties-1)
34
+ * [Token](#token-1)
35
+ * [Properties](#properties-2)
32
36
  * [setAttribute](#setattribute)
33
37
  * [Parameters](#parameters)
34
38
  * [getAttribute](#getattribute)
35
39
  * [Parameters](#parameters-1)
36
40
  * [getAttributeAndOperator](#getattributeandoperator)
37
41
  * [Parameters](#parameters-2)
38
- * [Token](#token)
39
- * [Properties](#properties-1)
40
42
  * [createToken](#createtoken)
41
43
  * [Parameters](#parameters-3)
42
44
  * [tokens](#tokens)
@@ -59,6 +61,22 @@ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
59
61
  * `get` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** get the value can be used to calculate default values
60
62
  * `env` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))?** environment variable use to provide the value
61
63
 
64
+ ## Token
65
+
66
+ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
67
+
68
+ ### Properties
69
+
70
+ * `str` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
71
+
72
+ ## Token
73
+
74
+ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
75
+
76
+ ### Properties
77
+
78
+ * `str` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
79
+
62
80
  ## setAttribute
63
81
 
64
82
  Set Object attribute.
@@ -94,14 +112,6 @@ The name may be a property path like 'a.b.c <='.
94
112
 
95
113
  Returns **\[any, [Token](#token)]** value associated with the given property name
96
114
 
97
- ## Token
98
-
99
- Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
100
-
101
- ### Properties
102
-
103
- * `str` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
104
-
105
115
  ## createToken
106
116
 
107
117
  ### Parameters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacc",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -8,8 +8,8 @@
8
8
  "types": "./types/attribute.d.mts",
9
9
  "exports": {
10
10
  ".": {
11
- "types": "./types/attribute.d.mts",
12
- "default": "./src/attribute.mjs"
11
+ "default": "./src/attribute.mjs",
12
+ "types": "./types/attribute.d.mts"
13
13
  }
14
14
  },
15
15
  "description": "property path utils",
@@ -40,7 +40,7 @@
40
40
  "typescript": "^5.3.3"
41
41
  },
42
42
  "engines": {
43
- "node": ">=20.11.0"
43
+ "node": ">=20.11.1"
44
44
  },
45
45
  "repository": {
46
46
  "type": "git",
package/src/attribute.mjs CHANGED
@@ -2,7 +2,9 @@
2
2
  * @typedef {Object} AttributeDefinition
3
3
  *
4
4
  * @property {string} type
5
+ * @property {boolean} isKey
5
6
  * @property {boolean} writable
7
+ * @property {boolean} mandatory
6
8
  * @property {boolean} [private] should the value be shown
7
9
  * @property {string} [depends] name of an attribute we depend on
8
10
  * @property {string[]} additionalAttributes extra attributes that are present in case our attribute is set
@@ -10,7 +12,7 @@
10
12
  * @property {any} [default] the default value
11
13
  * @property {Function} [set] set the value
12
14
  * @property {Function} [get] get the value can be used to calculate default values
13
- * @property {string[]|string} [env] environment variable use to provide the value
15
+ * @property {string[]|string} [env] environment variable(s) used to provide the value
14
16
  */
15
17
 
16
18
  /**
@@ -25,7 +25,9 @@ export function getAttributeAndOperator(object: any, expression: string): [any,
25
25
  export * from "./tokens.mjs";
26
26
  export type AttributeDefinition = {
27
27
  type: string;
28
+ isKey: boolean;
28
29
  writable: boolean;
30
+ mandatory: boolean;
29
31
  /**
30
32
  * should the value be shown
31
33
  */
@@ -52,7 +54,7 @@ export type AttributeDefinition = {
52
54
  */
53
55
  get?: Function;
54
56
  /**
55
- * environment variable use to provide the value
57
+ * environment variable(s) used to provide the value
56
58
  */
57
59
  env?: string[] | string;
58
60
  };