pema 0.12.1 → 0.14.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/lib/private/StoreType.js +2 -1
- package/lib/private/schema-errors.d.ts +34 -2
- package/lib/private/schema-errors.js +3 -2
- package/lib/public/ParseError.d.ts +2 -1
- package/lib/public/ParseError.js +2 -1
- package/lib/public/StoreType.d.ts +2 -1
- package/lib/public/StoreType.js +2 -1
- package/lib/public/index.d.ts +2 -1
- package/lib/public/index.js +2 -1
- package/package.json +2 -2
package/lib/private/StoreType.js
CHANGED
|
@@ -21,7 +21,8 @@ export default class StoreType extends ObjectType {
|
|
|
21
21
|
const input = x ?? {};
|
|
22
22
|
const out = {};
|
|
23
23
|
for (const k in this.properties) {
|
|
24
|
-
|
|
24
|
+
const generated = k === this.#pk;
|
|
25
|
+
if (generated && !(k in input))
|
|
25
26
|
continue;
|
|
26
27
|
const parsed = this.properties[k].parse(input[k], next(k, $options));
|
|
27
28
|
if (is.defined(parsed))
|
|
@@ -15,6 +15,38 @@ declare const errors: {
|
|
|
15
15
|
enum_invalid_key: (key: string) => import("@rcompat/error").CodeError<"enum_invalid_key">;
|
|
16
16
|
};
|
|
17
17
|
export type Code = keyof typeof errors;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
declare const schema_errors: {
|
|
19
|
+
unique_subtype_not_primitive: (subtype: string) => import("@rcompat/error").CodeError<"unique_subtype_not_primitive">;
|
|
20
|
+
min_negative: (limit: number) => import("@rcompat/error").CodeError<"min_negative">;
|
|
21
|
+
max_negative: (limit: number) => import("@rcompat/error").CodeError<"max_negative">;
|
|
22
|
+
length_not_finite: (from: number, to: number) => import("@rcompat/error").CodeError<"length_not_finite">;
|
|
23
|
+
length_not_positive: (from: number, to: number) => import("@rcompat/error").CodeError<"length_not_positive">;
|
|
24
|
+
length_not_integer: (from: number, to: number) => import("@rcompat/error").CodeError<"length_not_integer">;
|
|
25
|
+
length_from_exceeds_to: (from: number, to: number) => import("@rcompat/error").CodeError<"length_from_exceeds_to">;
|
|
26
|
+
min_limit_not_finite: (limit: number) => import("@rcompat/error").CodeError<"min_limit_not_finite">;
|
|
27
|
+
min_limit_not_integer: (limit: number) => import("@rcompat/error").CodeError<"min_limit_not_integer">;
|
|
28
|
+
max_limit_not_finite: (limit: number) => import("@rcompat/error").CodeError<"max_limit_not_finite">;
|
|
29
|
+
max_limit_not_integer: (limit: number) => import("@rcompat/error").CodeError<"max_limit_not_integer">;
|
|
30
|
+
extend_key_collision: (key: string) => import("@rcompat/error").CodeError<"extend_key_collision">;
|
|
31
|
+
union_at_least_two_members: () => import("@rcompat/error").CodeError<"union_at_least_two_members">;
|
|
32
|
+
enum_invalid_key: (key: string) => import("@rcompat/error").CodeError<"enum_invalid_key">;
|
|
33
|
+
} & {
|
|
34
|
+
Code: {
|
|
35
|
+
enum_invalid_key: "enum_invalid_key";
|
|
36
|
+
extend_key_collision: "extend_key_collision";
|
|
37
|
+
length_from_exceeds_to: "length_from_exceeds_to";
|
|
38
|
+
length_not_finite: "length_not_finite";
|
|
39
|
+
length_not_integer: "length_not_integer";
|
|
40
|
+
length_not_positive: "length_not_positive";
|
|
41
|
+
max_limit_not_finite: "max_limit_not_finite";
|
|
42
|
+
max_limit_not_integer: "max_limit_not_integer";
|
|
43
|
+
max_negative: "max_negative";
|
|
44
|
+
min_limit_not_finite: "min_limit_not_finite";
|
|
45
|
+
min_limit_not_integer: "min_limit_not_integer";
|
|
46
|
+
min_negative: "min_negative";
|
|
47
|
+
union_at_least_two_members: "union_at_least_two_members";
|
|
48
|
+
unique_subtype_not_primitive: "unique_subtype_not_primitive";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export default schema_errors;
|
|
20
52
|
//# sourceMappingURL=schema-errors.d.ts.map
|
|
@@ -16,6 +16,7 @@ const errors = error.coded({
|
|
|
16
16
|
union_at_least_two_members: () => t `union type must have at least two members`,
|
|
17
17
|
enum_invalid_key: (key) => t `enum: key ${key} must be SCREAMING_SNAKE_CASE`,
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const Code = Object.fromEntries(Object.keys(errors).map(k => [k, k]));
|
|
20
|
+
const schema_errors = Object.assign(errors, { Code });
|
|
21
|
+
export default schema_errors;
|
|
21
22
|
//# sourceMappingURL=schema-errors.js.map
|
package/lib/public/ParseError.js
CHANGED
package/lib/public/StoreType.js
CHANGED
package/lib/public/index.d.ts
CHANGED
package/lib/public/index.js
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"bugs": "https://github.com/primate-run/primate/issues",
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@rcompat/assert": "^0.16.0",
|
|
5
|
-
"@rcompat/cli": "^0.
|
|
5
|
+
"@rcompat/cli": "^0.29.0",
|
|
6
6
|
"@rcompat/error": "^0.11.0",
|
|
7
7
|
"@rcompat/is": "^0.14.0"
|
|
8
8
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"test": "proby"
|
|
49
49
|
},
|
|
50
50
|
"type": "module",
|
|
51
|
-
"version": "0.
|
|
51
|
+
"version": "0.14.0"
|
|
52
52
|
}
|