pacc 9.2.7 → 9.2.9
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 +3 -1
- package/package.json +9 -4
- package/src/common-attributes.mjs +1 -0
- package/src/expand.mjs +1 -0
- package/src/settergetter.mjs +2 -1
- package/src/tokens.mjs +4 -5
- package/src/types.mjs +1 -3
- package/types/common-attributes.d.mts +6 -0
- package/types/tokens.d.mts +2 -1
package/README.md
CHANGED
|
@@ -282,6 +282,7 @@ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
|
|
|
282
282
|
* `externalName` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** attribute name used by external system
|
|
283
283
|
* `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
|
|
284
284
|
* `additionalValues` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** other values to be set in case our attribute is set
|
|
285
|
+
* `separator` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** separator for collections
|
|
285
286
|
|
|
286
287
|
## default\_attribute
|
|
287
288
|
|
|
@@ -529,6 +530,7 @@ Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
529
530
|
## expandContextDefault
|
|
530
531
|
|
|
531
532
|
Default expand context
|
|
533
|
+
using '§{' and '}' as lead in/out
|
|
532
534
|
|
|
533
535
|
## expandContextDoubbleCurly
|
|
534
536
|
|
|
@@ -608,7 +610,7 @@ Split expression path into tokens.
|
|
|
608
610
|
### Parameters
|
|
609
611
|
|
|
610
612
|
* `string` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
611
|
-
* `context`
|
|
613
|
+
* `context` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
612
614
|
|
|
613
615
|
## setAttribute
|
|
614
616
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pacc",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -43,16 +43,21 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@mitata/counters": "^0.0.8",
|
|
46
|
-
"ava": "^8.0.
|
|
47
|
-
"browser-ava": "^2.3.
|
|
46
|
+
"ava": "^8.0.1",
|
|
47
|
+
"browser-ava": "^2.3.61",
|
|
48
48
|
"c8": "^11.0.0",
|
|
49
49
|
"documentation": "^14.0.3",
|
|
50
50
|
"mitata": "^1.0.34",
|
|
51
51
|
"semantic-release": "^25.0.3",
|
|
52
52
|
"typescript": "^6.0.3"
|
|
53
53
|
},
|
|
54
|
+
"overrides": {
|
|
55
|
+
"c8": {
|
|
56
|
+
"yargs": "^18.0.0"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
54
59
|
"engines": {
|
|
55
|
-
"node": ">=
|
|
60
|
+
"node": ">=26.2.0"
|
|
56
61
|
},
|
|
57
62
|
"repository": {
|
|
58
63
|
"type": "git",
|
|
@@ -23,6 +23,7 @@ import { types } from "./types.mjs";
|
|
|
23
23
|
* @property {string} [externalName] attribute name used by external system
|
|
24
24
|
* @property {string[]|string} [env] environment variable(s) used to provide the value
|
|
25
25
|
* @property {object} [additionalValues] other values to be set in case our attribute is set
|
|
26
|
+
* @property {string} [separator] separator for collections
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
/**
|
package/src/expand.mjs
CHANGED
package/src/settergetter.mjs
CHANGED
|
@@ -105,7 +105,8 @@ export function getAttributeAndOperator(object, expression) {
|
|
|
105
105
|
let predicateTokens;
|
|
106
106
|
let op = EQUAL;
|
|
107
107
|
|
|
108
|
-
const
|
|
108
|
+
const context = {};
|
|
109
|
+
const next = tokens(expression, context);
|
|
109
110
|
|
|
110
111
|
for (const token of next) {
|
|
111
112
|
switch (token[0]) {
|
package/src/tokens.mjs
CHANGED
|
@@ -317,14 +317,12 @@ export const keywords = {
|
|
|
317
317
|
|
|
318
318
|
function evalAll(args, current, context) {
|
|
319
319
|
return args.map(a =>
|
|
320
|
-
|
|
320
|
+
a.eval === undefined ? a : a.eval(a, current, context)
|
|
321
321
|
);
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
function evalOne(arg, current, context) {
|
|
325
|
-
return
|
|
326
|
-
? arg.eval(arg, current, context)
|
|
327
|
-
: arg;
|
|
325
|
+
return arg.eval === undefined ? arg : arg.eval(arg, current, context);
|
|
328
326
|
}
|
|
329
327
|
|
|
330
328
|
export const globals = {
|
|
@@ -414,9 +412,10 @@ export const globals = {
|
|
|
414
412
|
* Split expression path into tokens.
|
|
415
413
|
* @generator
|
|
416
414
|
* @param {string} string
|
|
415
|
+
* @param {Object} context
|
|
417
416
|
* @yields {Token}
|
|
418
417
|
*/
|
|
419
|
-
export function* tokens(string, context
|
|
418
|
+
export function* tokens(string, context) {
|
|
420
419
|
context.keywords ||= keywords;
|
|
421
420
|
context.parseFloat ||= parseFloat;
|
|
422
421
|
context.valueFor ||= (name, at) => globals[name];
|
package/src/types.mjs
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* @property {string} [externalName] attribute name used by external system
|
|
22
22
|
* @property {string[]|string} [env] environment variable(s) used to provide the value
|
|
23
23
|
* @property {object} [additionalValues] other values to be set in case our attribute is set
|
|
24
|
+
* @property {string} [separator] separator for collections
|
|
24
25
|
*/
|
|
25
26
|
/**
|
|
26
27
|
* Common attribute properties.
|
|
@@ -119,6 +120,7 @@ export namespace yesno_attribute_writable {
|
|
|
119
120
|
export let externalName: string | undefined;
|
|
120
121
|
export let env: string | string[] | undefined;
|
|
121
122
|
export let additionalValues: object | undefined;
|
|
123
|
+
export let separator: string | undefined;
|
|
122
124
|
}
|
|
123
125
|
/**
|
|
124
126
|
* @type {AttributeDefinition}
|
|
@@ -283,5 +285,9 @@ export type AttributeDefinition = {
|
|
|
283
285
|
* other values to be set in case our attribute is set
|
|
284
286
|
*/
|
|
285
287
|
additionalValues?: object | undefined;
|
|
288
|
+
/**
|
|
289
|
+
* separator for collections
|
|
290
|
+
*/
|
|
291
|
+
separator?: string | undefined;
|
|
286
292
|
};
|
|
287
293
|
export { default_attribute as string_attribute, default_attribute_writable as string_attribute_writable, description_attribute as description_attribute_writable, default_attribute as type_attribute, default_attribute_writable as state_attribute_writable, boolean_attribute_writable_true as active_attribute, boolean_attribute as empty_attribute, secret_attribute as username_attribute, secret_attribute as password_attribute, secret_attribute as token_attribute, secret_attribute as certificate_attribute, integer_attribute as count_attribute, integer_attribute_writable as count_attribute_writable, integer_attribute as size_attribute, default_attribute_writable as body_attribute_writable };
|
package/types/tokens.d.mts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* Split expression path into tokens.
|
|
3
3
|
* @generator
|
|
4
4
|
* @param {string} string
|
|
5
|
+
* @param {Object} context
|
|
5
6
|
* @yields {Token}
|
|
6
7
|
*/
|
|
7
|
-
export function tokens(string: string, context
|
|
8
|
+
export function tokens(string: string, context: Object): Generator<any, void, unknown>;
|
|
8
9
|
export namespace PLUS {
|
|
9
10
|
let str: string;
|
|
10
11
|
}
|