pacc 4.40.4 → 4.41.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacc",
3
- "version": "4.40.4",
3
+ "version": "4.41.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "ava": "^6.4.1",
42
- "browser-ava": "^2.3.43",
42
+ "browser-ava": "^2.3.44",
43
43
  "c8": "^10.1.3",
44
44
  "documentation": "^14.0.3",
45
45
  "semantic-release": "^25.0.1",
package/src/types.mjs CHANGED
@@ -26,6 +26,11 @@ export const types = {
26
26
  primitive: true,
27
27
  prepareValue: value => (typeof value === "string" ? parseInt(value) : value)
28
28
  },
29
+ duration: {
30
+ name: "duration",
31
+ primitive: true,
32
+ prepareValue: value => (typeof value === "string" ? parseFloat(value) : value)
33
+ },
29
34
  url: { name: "url", primitive: true },
30
35
  object: { name: "object" }
31
36
  };
@@ -76,9 +81,7 @@ export function addType(type) {
76
81
  break;
77
82
 
78
83
  case "string":
79
- if (typeof type.extends === "string") {
80
- type.extends = raiseOnUnknownType(type.extends, type);
81
- }
84
+ type.extends = raiseOnUnknownType(type.extends, type);
82
85
  break;
83
86
  }
84
87
 
@@ -105,7 +108,7 @@ export function oneOfType(definition) {
105
108
  name,
106
109
  members: list.reduce((all, type) => {
107
110
  if (typeof type === "string") {
108
- type = raiseOnUnknownType(type, definition); // addType({ name: type });
111
+ type = raiseOnUnknownType(type, definition);
109
112
  }
110
113
  return all.union(type.members ?? new Set([type]));
111
114
  }, new Set())
package/types/types.d.mts CHANGED
@@ -26,6 +26,11 @@ export const types: {
26
26
  primitive: boolean;
27
27
  prepareValue: (value: any) => any;
28
28
  };
29
+ duration: {
30
+ name: string;
31
+ primitive: boolean;
32
+ prepareValue: (value: any) => any;
33
+ };
29
34
  url: {
30
35
  name: string;
31
36
  primitive: boolean;