pacc 6.1.0 → 6.1.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 +21 -6
- package/package.json +1 -1
- package/src/time.mjs +16 -3
- package/types/time.d.mts +2 -2
package/README.md
CHANGED
|
@@ -63,7 +63,6 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
|
|
|
63
63
|
* [private\_key\_attribute](#private_key_attribute)
|
|
64
64
|
* [public\_key\_attribute](#public_key_attribute)
|
|
65
65
|
* [number\_attribute](#number_attribute)
|
|
66
|
-
* [number\_attribute](#number_attribute-1)
|
|
67
66
|
* [number\_attribute\_writable](#number_attribute_writable)
|
|
68
67
|
* [integer\_attribute](#integer_attribute)
|
|
69
68
|
* [integer\_attribute](#integer_attribute-1)
|
|
@@ -78,6 +77,8 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
|
|
|
78
77
|
* [id\_attribute](#id_attribute)
|
|
79
78
|
* [title\_attribute\_writable](#title_attribute_writable)
|
|
80
79
|
* [priority\_attribute](#priority_attribute)
|
|
80
|
+
* [duration\_attribute](#duration_attribute)
|
|
81
|
+
* [duration\_ms\_attribute](#duration_ms_attribute)
|
|
81
82
|
* [timeout\_attribute](#timeout_attribute)
|
|
82
83
|
* [language\_attribute](#language_attribute)
|
|
83
84
|
* [environmentValues](#environmentvalues)
|
|
@@ -101,11 +102,13 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
|
|
|
101
102
|
* [Parameters](#parameters-11)
|
|
102
103
|
* [getAttributeAndOperator](#getattributeandoperator)
|
|
103
104
|
* [Parameters](#parameters-12)
|
|
105
|
+
* [parseTime](#parsetime)
|
|
106
|
+
* [Parameters](#parameters-13)
|
|
104
107
|
* [lookup](#lookup)
|
|
105
108
|
* [Token](#token)
|
|
106
109
|
* [Properties](#properties-1)
|
|
107
110
|
* [createToken](#createtoken)
|
|
108
|
-
* [Parameters](#parameters-
|
|
111
|
+
* [Parameters](#parameters-14)
|
|
109
112
|
* [PLUS](#plus)
|
|
110
113
|
* [MINUS](#minus)
|
|
111
114
|
* [STAR](#star)
|
|
@@ -317,10 +320,6 @@ Type: [AttributeDefinition](#attributedefinition)
|
|
|
317
320
|
|
|
318
321
|
Type: [AttributeDefinition](#attributedefinition)
|
|
319
322
|
|
|
320
|
-
## number\_attribute
|
|
321
|
-
|
|
322
|
-
Type: [AttributeDefinition](#attributedefinition)
|
|
323
|
-
|
|
324
323
|
## number\_attribute\_writable
|
|
325
324
|
|
|
326
325
|
Type: [AttributeDefinition](#attributedefinition)
|
|
@@ -384,6 +383,14 @@ this defines the order.
|
|
|
384
383
|
|
|
385
384
|
Type: [AttributeDefinition](#attributedefinition)
|
|
386
385
|
|
|
386
|
+
## duration\_attribute
|
|
387
|
+
|
|
388
|
+
Type: [AttributeDefinition](#attributedefinition)
|
|
389
|
+
|
|
390
|
+
## duration\_ms\_attribute
|
|
391
|
+
|
|
392
|
+
Type: [AttributeDefinition](#attributedefinition)
|
|
393
|
+
|
|
387
394
|
## timeout\_attribute
|
|
388
395
|
|
|
389
396
|
Type: [AttributeDefinition](#attributedefinition)
|
|
@@ -511,6 +518,14 @@ The name may be a property path like 'a.b.c <='.
|
|
|
511
518
|
|
|
512
519
|
Returns **\[any, [Token](#token)]** value associated with the given property name
|
|
513
520
|
|
|
521
|
+
## parseTime
|
|
522
|
+
|
|
523
|
+
### Parameters
|
|
524
|
+
|
|
525
|
+
* `value` **([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** 
|
|
526
|
+
|
|
527
|
+
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
|
|
528
|
+
|
|
514
529
|
## lookup
|
|
515
530
|
|
|
516
531
|
Token lookup
|
package/package.json
CHANGED
package/src/time.mjs
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
const units = {
|
|
2
2
|
ms: 0.001,
|
|
3
|
+
millisecond: 0.001,
|
|
4
|
+
milliseconds: 0.001,
|
|
3
5
|
s: 1,
|
|
6
|
+
second: 1,
|
|
7
|
+
seconds: 1,
|
|
4
8
|
m: 60,
|
|
9
|
+
min: 60,
|
|
10
|
+
minute: 60,
|
|
11
|
+
minutes: 60,
|
|
5
12
|
h: 3600,
|
|
13
|
+
hour: 3600,
|
|
14
|
+
hours: 3600,
|
|
6
15
|
d: 86400,
|
|
7
|
-
|
|
16
|
+
day: 86400,
|
|
17
|
+
days: 86400,
|
|
18
|
+
w: 604800,
|
|
19
|
+
week: 604800,
|
|
20
|
+
weeks: 604800
|
|
8
21
|
};
|
|
9
22
|
|
|
10
23
|
/**
|
|
11
|
-
*
|
|
24
|
+
* Convert duration formatted string into number of seconds.
|
|
12
25
|
* @param {number|string} value
|
|
13
|
-
* @returns {number}
|
|
26
|
+
* @returns {number} seconds
|
|
14
27
|
*/
|
|
15
28
|
export function parseTime(value) {
|
|
16
29
|
if (typeof value === "string") {
|
package/types/time.d.mts
CHANGED