@agentuity/schema 1.0.17 → 1.0.19

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.
Files changed (101) hide show
  1. package/dist/coerce/boolean.d.ts +5 -5
  2. package/dist/coerce/boolean.d.ts.map +1 -1
  3. package/dist/coerce/boolean.js +3 -3
  4. package/dist/coerce/boolean.js.map +1 -1
  5. package/dist/coerce/date.d.ts +5 -5
  6. package/dist/coerce/date.d.ts.map +1 -1
  7. package/dist/coerce/date.js +3 -3
  8. package/dist/coerce/date.js.map +1 -1
  9. package/dist/coerce/number.d.ts +5 -5
  10. package/dist/coerce/number.d.ts.map +1 -1
  11. package/dist/coerce/number.js +3 -3
  12. package/dist/coerce/number.js.map +1 -1
  13. package/dist/coerce/string.d.ts +5 -5
  14. package/dist/coerce/string.d.ts.map +1 -1
  15. package/dist/coerce/string.js +3 -3
  16. package/dist/coerce/string.js.map +1 -1
  17. package/dist/complex/array.d.ts +5 -5
  18. package/dist/complex/array.d.ts.map +1 -1
  19. package/dist/complex/array.js +3 -3
  20. package/dist/complex/array.js.map +1 -1
  21. package/dist/complex/object.d.ts +5 -5
  22. package/dist/complex/object.d.ts.map +1 -1
  23. package/dist/complex/object.js +3 -3
  24. package/dist/complex/object.js.map +1 -1
  25. package/dist/complex/record.d.ts +5 -5
  26. package/dist/complex/record.d.ts.map +1 -1
  27. package/dist/complex/record.js +3 -3
  28. package/dist/complex/record.js.map +1 -1
  29. package/dist/index.d.ts +43 -43
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +39 -39
  32. package/dist/index.js.map +1 -1
  33. package/dist/json-schema.d.ts +1 -1
  34. package/dist/json-schema.d.ts.map +1 -1
  35. package/dist/json-schema.js +11 -11
  36. package/dist/json-schema.js.map +1 -1
  37. package/dist/primitives/any.d.ts +5 -5
  38. package/dist/primitives/any.d.ts.map +1 -1
  39. package/dist/primitives/any.js +3 -3
  40. package/dist/primitives/any.js.map +1 -1
  41. package/dist/primitives/boolean.d.ts +5 -5
  42. package/dist/primitives/boolean.d.ts.map +1 -1
  43. package/dist/primitives/boolean.js +3 -3
  44. package/dist/primitives/boolean.js.map +1 -1
  45. package/dist/primitives/null.d.ts +5 -5
  46. package/dist/primitives/null.d.ts.map +1 -1
  47. package/dist/primitives/null.js +3 -3
  48. package/dist/primitives/null.js.map +1 -1
  49. package/dist/primitives/number.d.ts +5 -5
  50. package/dist/primitives/number.d.ts.map +1 -1
  51. package/dist/primitives/number.js +3 -3
  52. package/dist/primitives/number.js.map +1 -1
  53. package/dist/primitives/string.d.ts +5 -5
  54. package/dist/primitives/string.d.ts.map +1 -1
  55. package/dist/primitives/string.js +3 -3
  56. package/dist/primitives/string.js.map +1 -1
  57. package/dist/primitives/undefined.d.ts +5 -5
  58. package/dist/primitives/undefined.d.ts.map +1 -1
  59. package/dist/primitives/undefined.js +3 -3
  60. package/dist/primitives/undefined.js.map +1 -1
  61. package/dist/primitives/unknown.d.ts +5 -5
  62. package/dist/primitives/unknown.d.ts.map +1 -1
  63. package/dist/primitives/unknown.js +3 -3
  64. package/dist/primitives/unknown.js.map +1 -1
  65. package/dist/utils/literal.d.ts +5 -5
  66. package/dist/utils/literal.d.ts.map +1 -1
  67. package/dist/utils/literal.js +3 -3
  68. package/dist/utils/literal.js.map +1 -1
  69. package/dist/utils/nullable.d.ts +3 -3
  70. package/dist/utils/nullable.d.ts.map +1 -1
  71. package/dist/utils/nullable.js +1 -1
  72. package/dist/utils/nullable.js.map +1 -1
  73. package/dist/utils/optional.d.ts +3 -3
  74. package/dist/utils/optional.d.ts.map +1 -1
  75. package/dist/utils/optional.js +1 -1
  76. package/dist/utils/optional.js.map +1 -1
  77. package/dist/utils/union.d.ts +5 -5
  78. package/dist/utils/union.d.ts.map +1 -1
  79. package/dist/utils/union.js +3 -3
  80. package/dist/utils/union.js.map +1 -1
  81. package/package.json +3 -3
  82. package/src/coerce/boolean.ts +4 -4
  83. package/src/coerce/date.ts +4 -4
  84. package/src/coerce/number.ts +4 -4
  85. package/src/coerce/string.ts +4 -4
  86. package/src/complex/array.ts +4 -4
  87. package/src/complex/object.ts +4 -4
  88. package/src/complex/record.ts +4 -4
  89. package/src/index.ts +43 -43
  90. package/src/json-schema.ts +12 -12
  91. package/src/primitives/any.ts +4 -4
  92. package/src/primitives/boolean.ts +4 -4
  93. package/src/primitives/null.ts +4 -4
  94. package/src/primitives/number.ts +4 -4
  95. package/src/primitives/string.ts +4 -4
  96. package/src/primitives/undefined.ts +4 -4
  97. package/src/primitives/unknown.ts +4 -4
  98. package/src/utils/literal.ts +4 -4
  99. package/src/utils/nullable.ts +2 -2
  100. package/src/utils/optional.ts +2 -2
  101. package/src/utils/union.ts +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"optional.d.ts","sourceRoot":"","sources":["../../src/utils/optional.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAA+B,WAAW,EAAE,MAAM,SAAS,CAAC;AAEnE;;;;;;;;;;;;;GAaG;AAEH,qBAAa,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CACrD,YAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAE7D,QAAQ,CAAC,CAAC,WAAW,CAAC,oBAAoB;IAC1C,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,WAAW;;;0BAGD,OAAO;eAMM;YAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;YAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;SAAE;MAC3F;IAGF,OAAO,CAAC,YAAY,CAA8C;gBAEtD,MAAM,EAAE,CAAC;IAIrB,QAA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;IAIR,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IAO5E,KAAK,oFAA2B;IAChC,SAAS,0HAA+B;CACxC;AAED;;;;;;;;;;;;GAYG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAEjF"}
@@ -1,4 +1,4 @@
1
- import { success, createParseMethods, SCHEMA_KIND } from '../base';
1
+ import { success, createParseMethods, SCHEMA_KIND } from "../base.js";
2
2
  /**
3
3
  * Schema for optional values (T | undefined).
4
4
  * Accepts undefined or the wrapped schema's type.
@@ -1 +1 @@
1
- {"version":3,"file":"optional.js","sourceRoot":"","sources":["../../src/utils/optional.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEnE;;;;;;;;;;;;;GAaG;AACH,8DAA8D;AAC9D,MAAM,OAAO,cAAc;IAGjB,CAAC,WAAW,CAAC,GAAG,gBAAgB,CAAC;IACjC,MAAM,CAAI;IACnB,WAAW,CAAU;IAEZ,WAAW,GAAG;QACtB,OAAO,EAAE,CAAU;QACnB,MAAM,EAAE,WAAW;QACnB,QAAQ,EAAE,CAAC,KAAc,EAAE,EAAE;YAC5B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACzB,OAAO,OAAO,CAAC,SAAiC,CAAC,CAAC;YACnD,CAAC;YACD,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACjD,CAAC;QACD,KAAK,EAAE,SAAqF;KAC5F,CAAC;IAEF,4CAA4C;IACpC,YAAY,GAAG,kBAAkB,EAAwB,CAAC;IAElE,YAAY,MAA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CAAC;QACD,KAAK,EAAE,SAAqF;KAC5F,CAAC;IAEF,4CAA4C;IACpC,YAAY,GAAG,kBAAkB,EAAwB,CAAC;IAElE,YAAY,MAAS;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAED,QAAQ,CAAC,WAAmB;QAC3B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,QAAQ;QACP,OAAO,IAAI,CAAC,CAAC,mBAAmB;IACjC,CAAC;IAED,QAAQ;QACP,2CAA2C;QAC3C,iEAAiE;QACjE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;QAC9C,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;IAChC,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;CACxC;AAED;;;;;;;;;;;;GAYG;AACH,8DAA8D;AAC9D,MAAM,UAAU,QAAQ,CAA6B,MAAS;IAC7D,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC"}
@@ -1,5 +1,5 @@
1
- import type { Schema, Infer } from '../base';
2
- import { SCHEMA_KIND } from '../base';
1
+ import type { Schema, Infer } from '../base.ts';
2
+ import { SCHEMA_KIND } from '../base.ts';
3
3
  type InferUnion<T extends Schema<any, any>[]> = Infer<T[number]>;
4
4
  /**
5
5
  * Schema for union types (one of multiple possible schemas).
@@ -36,10 +36,10 @@ export declare class UnionSchema<T extends Schema<any, any>[]> implements Schema
36
36
  };
37
37
  };
38
38
  describe(description: string): this;
39
- optional(): import("..").OptionalSchema<this>;
40
- nullable(): import("..").NullableSchema<this>;
39
+ optional(): import("../index.ts").OptionalSchema<this>;
40
+ nullable(): import("../index.ts").NullableSchema<this>;
41
41
  parse: (this: Schema<any, InferUnion<T>>, value: unknown) => InferUnion<T>;
42
- safeParse: (this: Schema<any, InferUnion<T>>, value: unknown) => import("..").SafeParseResult<InferUnion<T>>;
42
+ safeParse: (this: Schema<any, InferUnion<T>>, value: unknown) => import("../base.ts").SafeParseResult<InferUnion<T>>;
43
43
  }
44
44
  /**
45
45
  * Create a union schema (one of multiple possible types).
@@ -1 +1 @@
1
- {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../src/utils/union.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAA4C,WAAW,EAAE,MAAM,SAAS,CAAC;AAKhF,KAAK,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEjE;;;;;;;;;;;;;;;;;;GAkBG;AAEH,qBAAa,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CACpD,YAAW,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAMnC,OAAO,CAAC,OAAO;IAJ3B,QAAQ,CAAC,CAAC,WAAW,CAAC,iBAAiB;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,YAAY,CAAuC;gBAEvC,OAAO,EAAE,CAAC;IAE9B,QAAQ,CAAC,WAAW;;;0BAGD,OAAO;eAwBM;YAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;YAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA;SAAE;MAC7E;IAEF,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAKnC,QAAQ;IAIR,QAAQ;IAIR,KAAK,sEAA2B;IAChC,SAAS,oGAA+B;CACxC;AAED;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,KAAK,CAAC,CA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,WAAW,CAAC,CAAC,CAAC,CAEjF"}
@@ -1,6 +1,6 @@
1
- import { createIssue, failure, createParseMethods, SCHEMA_KIND } from '../base';
2
- import { optional } from '../utils/optional';
3
- import { nullable } from '../utils/nullable';
1
+ import { createIssue, failure, createParseMethods, SCHEMA_KIND } from "../base.js";
2
+ import { optional } from "../utils/optional.js";
3
+ import { nullable } from "../utils/nullable.js";
4
4
  /**
5
5
  * Schema for union types (one of multiple possible schemas).
6
6
  * Validates against each schema until one succeeds.
@@ -1 +1 @@
1
- {"version":3,"file":"union.js","sourceRoot":"","sources":["../../src/utils/union.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAK7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,8DAA8D;AAC9D,MAAM,OAAO,WAAW;IAOH;IAJX,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC;IACvC,WAAW,CAAU;IACb,YAAY,GAAG,kBAAkB,EAAiB,CAAC;IAE3D,YAAoB,OAAU;QAAV,YAAO,GAAP,OAAO,CAAG;IAAG,CAAC;IAEzB,WAAW,GAAG;QACtB,OAAO,EAAE,CAAU;QACnB,MAAM,EAAE,WAAW;QACnB,QAAQ,EAAE,CAAC,KAAc,EAAE,EAAE;YAC5B,MAAM,SAAS,GAAqC,EAAE,CAAC;YAEvD,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACnC,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAEnD,8CAA8C;gBAC9C,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;oBAC/B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;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AeG;AACH,8DAA8D;AAC9D,MAAM,UAAU,KAAK,CAA+B,GAAG,OAAU;IAChE,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentuity/schema",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Agentuity employees and contributors",
6
6
  "type": "module",
@@ -26,10 +26,10 @@
26
26
  "prepublishOnly": "bun run clean && bun run build"
27
27
  },
28
28
  "dependencies": {
29
- "@agentuity/core": "1.0.17"
29
+ "@agentuity/core": "1.0.19"
30
30
  },
31
31
  "devDependencies": {
32
- "@agentuity/test-utils": "1.0.17",
32
+ "@agentuity/test-utils": "1.0.19",
33
33
  "@types/bun": "latest",
34
34
  "bun-types": "latest",
35
35
  "typescript": "^5.9.0"
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  const parseMethods = createParseMethods<boolean>();
7
7
 
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  const parseMethods = createParseMethods<Date>();
7
7
 
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  const parseMethods = createParseMethods<number>();
7
7
 
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  const parseMethods = createParseMethods<string>();
7
7
 
@@ -1,7 +1,7 @@
1
- import type { Schema, Infer } from '../base';
2
- import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema, Infer } from '../base.ts';
2
+ import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  /**
7
7
  * Schema for validating arrays with typed elements.
@@ -1,7 +1,7 @@
1
- import type { Schema, Infer } from '../base';
2
- import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional, OptionalSchema } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema, Infer } from '../base.ts';
2
+ import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional, OptionalSchema } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
7
  type ObjectShape = Record<string, Schema<any, any>>;
@@ -1,7 +1,7 @@
1
- import type { Schema, Infer } from '../base';
2
- import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema, Infer } from '../base.ts';
2
+ import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  /**
7
7
  * Schema for validating records (objects with string keys and typed values).
package/src/index.ts CHANGED
@@ -8,61 +8,61 @@ export type {
8
8
  SafeParseResult,
9
9
  SafeParseSuccess,
10
10
  SafeParseError,
11
- } from './base';
12
- export { createIssue, success, failure, ValidationError, SCHEMA_KIND } from './base';
11
+ } from './base.ts';
12
+ export { createIssue, success, failure, ValidationError, SCHEMA_KIND } from './base.ts';
13
13
 
14
- export { StringSchema, string } from './primitives/string';
15
- export { NumberSchema, number } from './primitives/number';
16
- export { BooleanSchema, boolean } from './primitives/boolean';
17
- export { NullSchema, null_ } from './primitives/null';
18
- export { UndefinedSchema, undefined_ } from './primitives/undefined';
19
- export { UnknownSchema, unknown } from './primitives/unknown';
20
- export { AnySchema, any } from './primitives/any';
14
+ export { StringSchema, string } from './primitives/string.ts';
15
+ export { NumberSchema, number } from './primitives/number.ts';
16
+ export { BooleanSchema, boolean } from './primitives/boolean.ts';
17
+ export { NullSchema, null_ } from './primitives/null.ts';
18
+ export { UndefinedSchema, undefined_ } from './primitives/undefined.ts';
19
+ export { UnknownSchema, unknown } from './primitives/unknown.ts';
20
+ export { AnySchema, any } from './primitives/any.ts';
21
21
 
22
- export { ObjectSchema, object } from './complex/object';
23
- export { ArraySchema, array } from './complex/array';
24
- export { RecordSchema, record } from './complex/record';
22
+ export { ObjectSchema, object } from './complex/object.ts';
23
+ export { ArraySchema, array } from './complex/array.ts';
24
+ export { RecordSchema, record } from './complex/record.ts';
25
25
 
26
- export { LiteralSchema, literal } from './utils/literal';
27
- export { OptionalSchema, optional } from './utils/optional';
28
- export { NullableSchema, nullable } from './utils/nullable';
29
- export { UnionSchema, union } from './utils/union';
26
+ export { LiteralSchema, literal } from './utils/literal.ts';
27
+ export { OptionalSchema, optional } from './utils/optional.ts';
28
+ export { NullableSchema, nullable } from './utils/nullable.ts';
29
+ export { UnionSchema, union } from './utils/union.ts';
30
30
 
31
31
  export {
32
32
  toJSONSchema,
33
33
  fromJSONSchema,
34
34
  type JSONSchema,
35
35
  type ToJSONSchemaOptions,
36
- } from './json-schema';
36
+ } from './json-schema.ts';
37
37
 
38
- export { CoerceStringSchema, coerceString } from './coerce/string';
39
- export { CoerceNumberSchema, coerceNumber } from './coerce/number';
40
- export { CoerceBooleanSchema, coerceBoolean } from './coerce/boolean';
41
- export { CoerceDateSchema, coerceDate } from './coerce/date';
38
+ export { CoerceStringSchema, coerceString } from './coerce/string.ts';
39
+ export { CoerceNumberSchema, coerceNumber } from './coerce/number.ts';
40
+ export { CoerceBooleanSchema, coerceBoolean } from './coerce/boolean.ts';
41
+ export { CoerceDateSchema, coerceDate } from './coerce/date.ts';
42
42
 
43
- import { string } from './primitives/string';
44
- import { number } from './primitives/number';
45
- import { boolean } from './primitives/boolean';
46
- import { null_ } from './primitives/null';
47
- import { undefined_ } from './primitives/undefined';
48
- import { unknown } from './primitives/unknown';
49
- import { any } from './primitives/any';
50
- import { object } from './complex/object';
51
- import { array } from './complex/array';
52
- import { record } from './complex/record';
53
- import { literal } from './utils/literal';
54
- import { optional } from './utils/optional';
55
- import { nullable } from './utils/nullable';
56
- import { union } from './utils/union';
57
- import { toJSONSchema, fromJSONSchema } from './json-schema';
58
- import { coerceString } from './coerce/string';
59
- import { coerceNumber } from './coerce/number';
60
- import { coerceBoolean } from './coerce/boolean';
61
- import { coerceDate } from './coerce/date';
43
+ import { string } from './primitives/string.ts';
44
+ import { number } from './primitives/number.ts';
45
+ import { boolean } from './primitives/boolean.ts';
46
+ import { null_ } from './primitives/null.ts';
47
+ import { undefined_ } from './primitives/undefined.ts';
48
+ import { unknown } from './primitives/unknown.ts';
49
+ import { any } from './primitives/any.ts';
50
+ import { object } from './complex/object.ts';
51
+ import { array } from './complex/array.ts';
52
+ import { record } from './complex/record.ts';
53
+ import { literal } from './utils/literal.ts';
54
+ import { optional } from './utils/optional.ts';
55
+ import { nullable } from './utils/nullable.ts';
56
+ import { union } from './utils/union.ts';
57
+ import { toJSONSchema, fromJSONSchema } from './json-schema.ts';
58
+ import { coerceString } from './coerce/string.ts';
59
+ import { coerceNumber } from './coerce/number.ts';
60
+ import { coerceBoolean } from './coerce/boolean.ts';
61
+ import { coerceDate } from './coerce/date.ts';
62
62
 
63
- import type { Infer as InferType, Schema } from './base';
64
- import { LiteralSchema } from './utils/literal';
65
- import { UnionSchema } from './utils/union';
63
+ import type { Infer as InferType, Schema } from './base.ts';
64
+ import { LiteralSchema } from './utils/literal.ts';
65
+ import { UnionSchema } from './utils/union.ts';
66
66
 
67
67
  /**
68
68
  * Create an enum schema (union of literal values).
@@ -1,16 +1,16 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import type { Schema } from './base';
3
- import { SCHEMA_KIND } from './base';
4
- import { string } from './primitives/string';
5
- import { number } from './primitives/number';
6
- import { boolean } from './primitives/boolean';
7
- import { null_ } from './primitives/null';
8
- import { object } from './complex/object';
9
- import { array } from './complex/array';
10
- import { literal } from './utils/literal';
11
- import { optional } from './utils/optional';
12
- import { nullable } from './utils/nullable';
13
- import { union } from './utils/union';
2
+ import type { Schema } from './base.ts';
3
+ import { SCHEMA_KIND } from './base.ts';
4
+ import { string } from './primitives/string.ts';
5
+ import { number } from './primitives/number.ts';
6
+ import { boolean } from './primitives/boolean.ts';
7
+ import { null_ } from './primitives/null.ts';
8
+ import { object } from './complex/object.ts';
9
+ import { array } from './complex/array.ts';
10
+ import { literal } from './utils/literal.ts';
11
+ import { optional } from './utils/optional.ts';
12
+ import { nullable } from './utils/nullable.ts';
13
+ import { union } from './utils/union.ts';
14
14
 
15
15
  /**
16
16
  * Check schema type using a minification-safe SCHEMA_KIND tag.
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
7
  const parseMethods = createParseMethods<any>();
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  const parseMethods = createParseMethods<boolean>();
7
7
 
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  const parseMethods = createParseMethods<null>();
7
7
 
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  const parseMethods = createParseMethods<number>();
7
7
 
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  const parseMethods = createParseMethods<string>();
7
7
 
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  const parseMethods = createParseMethods<undefined>();
7
7
 
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  const parseMethods = createParseMethods<unknown>();
7
7
 
@@ -1,7 +1,7 @@
1
- import type { Schema } from '../base';
2
- import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema } from '../base.ts';
2
+ import { createIssue, failure, success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  /**
7
7
  * Schema for validating exact literal values.
@@ -1,5 +1,5 @@
1
- import type { Schema, Infer } from '../base';
2
- import { success, createParseMethods, SCHEMA_KIND } from '../base';
1
+ import type { Schema, Infer } from '../base.ts';
2
+ import { success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
3
 
4
4
  /**
5
5
  * Schema for nullable values (T | null).
@@ -1,5 +1,5 @@
1
- import type { Schema, Infer } from '../base';
2
- import { success, createParseMethods, SCHEMA_KIND } from '../base';
1
+ import type { Schema, Infer } from '../base.ts';
2
+ import { success, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
3
 
4
4
  /**
5
5
  * Schema for optional values (T | undefined).
@@ -1,7 +1,7 @@
1
- import type { Schema, Infer } from '../base';
2
- import { createIssue, failure, createParseMethods, SCHEMA_KIND } from '../base';
3
- import { optional } from '../utils/optional';
4
- import { nullable } from '../utils/nullable';
1
+ import type { Schema, Infer } from '../base.ts';
2
+ import { createIssue, failure, createParseMethods, SCHEMA_KIND } from '../base.ts';
3
+ import { optional } from '../utils/optional.ts';
4
+ import { nullable } from '../utils/nullable.ts';
5
5
 
6
6
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
7
  type InferUnion<T extends Schema<any, any>[]> = Infer<T[number]>;