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