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.
@@ -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
- if (k === this.#pk && !(k in input))
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
- export declare const Code: { [K in Code]: K; };
19
- export default errors;
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
- export const Code = Object.fromEntries(Object.keys(errors).map(k => [k, k]));
20
- export default errors;
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
@@ -1,2 +1,3 @@
1
- export { default } from "#ParseError";
1
+ import ParseError from "#ParseError";
2
+ export default ParseError;
2
3
  //# sourceMappingURL=ParseError.d.ts.map
@@ -1,2 +1,3 @@
1
- export { default } from "#ParseError";
1
+ import ParseError from "#ParseError";
2
+ export default ParseError;
2
3
  //# sourceMappingURL=ParseError.js.map
@@ -1,3 +1,4 @@
1
1
  export type { default as Serialized } from "#Serialized";
2
- export { default } from "#StoreType";
2
+ import StoreType from "#StoreType";
3
+ export default StoreType;
3
4
  //# sourceMappingURL=StoreType.d.ts.map
@@ -1,2 +1,3 @@
1
- export { default } from "#StoreType";
1
+ import StoreType from "#StoreType";
2
+ export default StoreType;
2
3
  //# sourceMappingURL=StoreType.js.map
@@ -1,3 +1,4 @@
1
1
  export type * from "#index";
2
- export { default } from "#index";
2
+ import pema from "#index";
3
+ export default pema;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,3 @@
1
- export { default } from "#index";
1
+ import pema from "#index";
2
+ export default pema;
2
3
  //# sourceMappingURL=index.js.map
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.28.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.12.1"
51
+ "version": "0.14.0"
52
52
  }