pacc 8.8.0 → 8.9.0

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
@@ -464,6 +464,8 @@ Type: [AttributeDefinition](#attributedefinition)
464
464
 
465
465
  ## duration\_attribute
466
466
 
467
+ Duration in seconds.
468
+
467
469
  Type: [AttributeDefinition](#attributedefinition)
468
470
 
469
471
  ## duration\_attribute\_writable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacc",
3
- "version": "8.8.0",
3
+ "version": "8.9.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -397,6 +397,7 @@ export const priority_attribute = {
397
397
  };
398
398
 
399
399
  /**
400
+ * Duration in seconds.
400
401
  * @type {AttributeDefinition}
401
402
  */
402
403
  export const duration_attribute = {
@@ -43,9 +43,19 @@ export function parseOnly(input, context = {}) {
43
43
  const nud = (last, left) => {
44
44
  switch (last) {
45
45
  case OPEN_ROUND: {
46
- const node = expression(0);
46
+
47
+ const sequence = [];
48
+
49
+ while (token !== CLOSE_ROUND) {
50
+ sequence.push(expression(0));
51
+ if (token === COMMA) {
52
+ advance();
53
+ }
54
+ }
47
55
  expect(CLOSE_ROUND);
48
- return node;
56
+
57
+ // TODO always a sequence ?
58
+ return sequence.length > 1 ? sequence : sequence[0];
49
59
  }
50
60
  case OPEN_BRACKET: {
51
61
  if (token === CLOSE_BRACKET) {
@@ -171,6 +181,7 @@ export const globals = {
171
181
  decodeURI: decodeURI,
172
182
  encodeURIComponent: encodeURIComponent,
173
183
  decodeURIComponent: decodeURIComponent,
184
+ trim: a => a.trim(),
174
185
  uppercase: a => a.toUpperCase(),
175
186
  lowercase: a => a.toLowerCase(),
176
187
  substring: (s, a, b) => s.substring(a, b),
@@ -203,6 +203,7 @@ export const title_attribute_writable: AttributeDefinition;
203
203
  */
204
204
  export const priority_attribute: AttributeDefinition;
205
205
  /**
206
+ * Duration in seconds.
206
207
  * @type {AttributeDefinition}
207
208
  */
208
209
  export const duration_attribute: AttributeDefinition;
@@ -12,6 +12,7 @@ export namespace globals {
12
12
  export let decodeURI: typeof globalThis.decodeURI;
13
13
  export let encodeURIComponent: typeof globalThis.encodeURIComponent;
14
14
  export let decodeURIComponent: typeof globalThis.decodeURIComponent;
15
+ export function trim(a: any): any;
15
16
  export function uppercase(a: any): any;
16
17
  export function lowercase(a: any): any;
17
18
  export function substring(s: any, a: any, b: any): any;