pacc 6.6.3 → 6.7.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/LICENSE +1 -1
- package/README.md +24 -3
- package/package.json +1 -1
- package/src/attributes.mjs +1 -1
- package/src/common-attributes.mjs +8 -0
- package/src/multiple.mjs +1 -1
- package/src/tokens.mjs +2 -0
- package/types/attributes.d.mts +2 -2
- package/types/common-attributes.d.mts +4 -0
- package/types/multiple.d.mts +2 -2
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -81,6 +81,7 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
|
|
|
81
81
|
* [title\_attribute\_writable](#title_attribute_writable)
|
|
82
82
|
* [priority\_attribute](#priority_attribute)
|
|
83
83
|
* [duration\_attribute](#duration_attribute)
|
|
84
|
+
* [duration\_attribute\_writable](#duration_attribute_writable)
|
|
84
85
|
* [duration\_ms\_attribute](#duration_ms_attribute)
|
|
85
86
|
* [timeout\_attribute](#timeout_attribute)
|
|
86
87
|
* [language\_attribute](#language_attribute)
|
|
@@ -88,6 +89,7 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
|
|
|
88
89
|
* [Parameters](#parameters-4)
|
|
89
90
|
* [expand](#expand)
|
|
90
91
|
* [Parameters](#parameters-5)
|
|
92
|
+
* [promises](#promises)
|
|
91
93
|
* [filter](#filter)
|
|
92
94
|
* [Parameters](#parameters-6)
|
|
93
95
|
* [setAttributes](#setattributes)
|
|
@@ -146,6 +148,8 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
|
|
|
146
148
|
* [EOF](#eof)
|
|
147
149
|
* [Type](#type)
|
|
148
150
|
* [Properties](#properties-2)
|
|
151
|
+
* [raiseOnUnknownType](#raiseonunknowntype)
|
|
152
|
+
* [Parameters](#parameters-18)
|
|
149
153
|
|
|
150
154
|
## prepareAttributesDefinitions
|
|
151
155
|
|
|
@@ -176,7 +180,7 @@ Iterate over all attributes.
|
|
|
176
180
|
### Parameters
|
|
177
181
|
|
|
178
182
|
* `definition` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
179
|
-
* `filter` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)
|
|
183
|
+
* `filter` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** 
|
|
180
184
|
* `path` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** (optional, default `[]`)
|
|
181
185
|
|
|
182
186
|
Returns **Iterable<\[[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>, [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)]>** 
|
|
@@ -409,6 +413,10 @@ Type: [AttributeDefinition](#attributedefinition)
|
|
|
409
413
|
|
|
410
414
|
Type: [AttributeDefinition](#attributedefinition)
|
|
411
415
|
|
|
416
|
+
## duration\_attribute\_writable
|
|
417
|
+
|
|
418
|
+
Type: [AttributeDefinition](#attributedefinition)
|
|
419
|
+
|
|
412
420
|
## duration\_ms\_attribute
|
|
413
421
|
|
|
414
422
|
Type: [AttributeDefinition](#attributedefinition)
|
|
@@ -442,13 +450,17 @@ Expand expressions inside of object graphs.
|
|
|
442
450
|
* `object` **any** 
|
|
443
451
|
* `context` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
|
|
444
452
|
|
|
445
|
-
* `context.root` **any
|
|
453
|
+
* `context.root` **any?** 
|
|
446
454
|
* `context.stopClass` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** 
|
|
447
455
|
* `context.leadIn` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
448
456
|
* `context.leadOut` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
449
457
|
|
|
450
458
|
Returns **any** 
|
|
451
459
|
|
|
460
|
+
## promises
|
|
461
|
+
|
|
462
|
+
Type: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<any>>
|
|
463
|
+
|
|
452
464
|
## filter
|
|
453
465
|
|
|
454
466
|
Generate filter function.
|
|
@@ -489,7 +501,7 @@ Retrive attribute values from an object.
|
|
|
489
501
|
|
|
490
502
|
* `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** attribute value source
|
|
491
503
|
* `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
492
|
-
* `filter` **[
|
|
504
|
+
* `filter` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** 
|
|
493
505
|
|
|
494
506
|
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** values
|
|
495
507
|
|
|
@@ -710,6 +722,15 @@ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
|
|
|
710
722
|
* `primitive` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** 
|
|
711
723
|
* `prepareValue` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** 
|
|
712
724
|
|
|
725
|
+
## raiseOnUnknownType
|
|
726
|
+
|
|
727
|
+
### Parameters
|
|
728
|
+
|
|
729
|
+
* `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** 
|
|
730
|
+
* `origin` **any** 
|
|
731
|
+
|
|
732
|
+
Returns **[Type](#type)** 
|
|
733
|
+
|
|
713
734
|
# install
|
|
714
735
|
|
|
715
736
|
With [npm](http://npmjs.org) do:
|
package/package.json
CHANGED
package/src/attributes.mjs
CHANGED
|
@@ -47,7 +47,7 @@ function mergeAttributeDefinitions(dest, atts) {
|
|
|
47
47
|
/**
|
|
48
48
|
* Iterate over all attributes.
|
|
49
49
|
* @param {Object} definition
|
|
50
|
-
* @param {Function} filter
|
|
50
|
+
* @param {Function} [filter]
|
|
51
51
|
* @param {string[]} path
|
|
52
52
|
* @return {Iterable<[string[],object]>}
|
|
53
53
|
*/
|
|
@@ -367,6 +367,14 @@ export const duration_attribute = {
|
|
|
367
367
|
type: types.duration
|
|
368
368
|
};
|
|
369
369
|
|
|
370
|
+
/**
|
|
371
|
+
* @type {AttributeDefinition}
|
|
372
|
+
*/
|
|
373
|
+
export const duration_attribute_writable = {
|
|
374
|
+
...duration_attribute,
|
|
375
|
+
writable: true
|
|
376
|
+
};
|
|
377
|
+
|
|
370
378
|
/**
|
|
371
379
|
* @type {AttributeDefinition}
|
|
372
380
|
*/
|
package/src/multiple.mjs
CHANGED
|
@@ -60,7 +60,7 @@ export function getAttributes(object, definitions) {
|
|
|
60
60
|
* Retrive attribute values from an object.
|
|
61
61
|
* @param {Object} object attribute value source
|
|
62
62
|
* @param {Object} definitions
|
|
63
|
-
* @param {
|
|
63
|
+
* @param {Function} [filter]
|
|
64
64
|
* @return {Object} values
|
|
65
65
|
*/
|
|
66
66
|
export function getAttributesJSON(object, definitions, filter) {
|
package/src/tokens.mjs
CHANGED
package/types/attributes.d.mts
CHANGED
|
@@ -8,11 +8,11 @@ export function prepareAttributesDefinitions(newDefinitions: any, presentDefinit
|
|
|
8
8
|
/**
|
|
9
9
|
* Iterate over all attributes.
|
|
10
10
|
* @param {Object} definition
|
|
11
|
-
* @param {Function} filter
|
|
11
|
+
* @param {Function} [filter]
|
|
12
12
|
* @param {string[]} path
|
|
13
13
|
* @return {Iterable<[string[],object]>}
|
|
14
14
|
*/
|
|
15
|
-
export function attributeIterator(definition: any, filter
|
|
15
|
+
export function attributeIterator(definition: any, filter?: Function, path?: string[]): Iterable<[string[], object]>;
|
|
16
16
|
export function writableAttributeIterator(definition: any): Generator<[string[], any], void, any>;
|
|
17
17
|
export function prepareValue(value: any, attribute: any): any;
|
|
18
18
|
export function mandatoryAttributesPresent(object: any, attributes: any): boolean;
|
|
@@ -186,6 +186,10 @@ export const priority_attribute: AttributeDefinition;
|
|
|
186
186
|
* @type {AttributeDefinition}
|
|
187
187
|
*/
|
|
188
188
|
export const duration_attribute: AttributeDefinition;
|
|
189
|
+
/**
|
|
190
|
+
* @type {AttributeDefinition}
|
|
191
|
+
*/
|
|
192
|
+
export const duration_attribute_writable: AttributeDefinition;
|
|
189
193
|
/**
|
|
190
194
|
* @type {AttributeDefinition}
|
|
191
195
|
*/
|
package/types/multiple.d.mts
CHANGED
|
@@ -17,7 +17,7 @@ export function getAttributes(object: any, definitions: any): any;
|
|
|
17
17
|
* Retrive attribute values from an object.
|
|
18
18
|
* @param {Object} object attribute value source
|
|
19
19
|
* @param {Object} definitions
|
|
20
|
-
* @param {
|
|
20
|
+
* @param {Function} [filter]
|
|
21
21
|
* @return {Object} values
|
|
22
22
|
*/
|
|
23
|
-
export function getAttributesJSON(object: any, definitions: any, filter
|
|
23
|
+
export function getAttributesJSON(object: any, definitions: any, filter?: Function): any;
|