@sinclair/typebox 0.32.0-dev-26 → 0.32.0-dev-27

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 (198) hide show
  1. package/build/import/index.d.mts +2 -2
  2. package/build/import/type/awaited/awaited.mjs +2 -6
  3. package/build/import/type/composite/composite.d.mts +1 -2
  4. package/build/import/type/composite/composite.mjs +2 -2
  5. package/build/import/type/const/const.mjs +6 -6
  6. package/build/import/type/constructor/constructor.d.mts +1 -1
  7. package/build/import/type/constructor/constructor.mjs +1 -1
  8. package/build/import/type/deref/deref.mjs +1 -2
  9. package/build/import/type/discard/discard.mjs +2 -2
  10. package/build/import/type/enum/enum.mjs +3 -0
  11. package/build/import/type/exclude/exclude-from-mapped-result.d.mts +5 -5
  12. package/build/import/type/exclude/exclude-from-mapped-result.mjs +7 -7
  13. package/build/import/type/exclude/exclude.mjs +0 -1
  14. package/build/import/type/extends/extends-from-mapped-key.d.mts +1 -1
  15. package/build/import/type/extends/extends-from-mapped-key.mjs +4 -5
  16. package/build/import/type/extends/extends-from-mapped-result.d.mts +5 -5
  17. package/build/import/type/extends/extends-from-mapped-result.mjs +7 -7
  18. package/build/import/type/extends/extends.mjs +0 -1
  19. package/build/import/type/extract/extract-from-mapped-result.d.mts +5 -5
  20. package/build/import/type/extract/extract-from-mapped-result.mjs +7 -7
  21. package/build/import/type/extract/extract.d.mts +1 -2
  22. package/build/import/type/extract/extract.mjs +4 -2
  23. package/build/import/type/index.d.mts +1 -1
  24. package/build/import/type/index.mjs +1 -1
  25. package/build/import/type/indexed/indexed-from-mapped-key.d.mts +2 -2
  26. package/build/import/type/indexed/indexed-from-mapped-key.mjs +4 -5
  27. package/build/import/type/indexed/indexed-from-mapped-result.d.mts +1 -1
  28. package/build/import/type/indexed/indexed-property-keys.d.mts +6 -6
  29. package/build/import/type/indexed/indexed-property-keys.mjs +3 -5
  30. package/build/import/type/indexed/indexed.d.mts +1 -1
  31. package/build/import/type/indexed/indexed.mjs +9 -27
  32. package/build/import/type/intersect/intersect-evaluated.mjs +3 -13
  33. package/build/import/type/intrinsic/capitalize.d.mts +2 -2
  34. package/build/import/type/intrinsic/intrinsic-from-mapped-key.d.mts +1 -1
  35. package/build/import/type/intrinsic/intrinsic-from-mapped-key.mjs +4 -5
  36. package/build/import/type/intrinsic/intrinsic.d.mts +2 -3
  37. package/build/import/type/intrinsic/intrinsic.mjs +2 -5
  38. package/build/import/type/intrinsic/lowercase.d.mts +2 -2
  39. package/build/import/type/intrinsic/uncapitalize.d.mts +2 -2
  40. package/build/import/type/intrinsic/uppercase.d.mts +2 -2
  41. package/build/import/type/iterator/iterator.mjs +1 -1
  42. package/build/import/type/keyof/keyof-from-mapped-result.d.mts +3 -3
  43. package/build/import/type/keyof/keyof-from-mapped-result.mjs +4 -4
  44. package/build/import/type/keyof/keyof-property-keys.d.mts +3 -3
  45. package/build/import/type/keyof/keyof-property-keys.mjs +9 -15
  46. package/build/import/type/keyof/keyof.mjs +2 -8
  47. package/build/import/type/mapped/mapped.d.mts +6 -1
  48. package/build/import/type/mapped/mapped.mjs +21 -14
  49. package/build/import/type/not/not.mjs +1 -1
  50. package/build/import/type/object/object.d.mts +1 -1
  51. package/build/import/type/object/object.mjs +0 -1
  52. package/build/import/type/omit/index.d.mts +1 -0
  53. package/build/import/type/omit/index.mjs +1 -0
  54. package/build/import/type/omit/omit-from-mapped-key.mjs +4 -5
  55. package/build/import/type/omit/omit-from-mapped-result.d.mts +11 -0
  56. package/build/import/type/omit/omit-from-mapped-result.mjs +17 -0
  57. package/build/import/type/omit/omit.d.mts +6 -3
  58. package/build/import/type/omit/omit.mjs +11 -9
  59. package/build/import/type/optional/optional-from-mapped-result.d.mts +5 -5
  60. package/build/import/type/optional/optional-from-mapped-result.mjs +7 -7
  61. package/build/import/type/partial/partial-from-mapped-result.d.mts +5 -5
  62. package/build/import/type/partial/partial-from-mapped-result.mjs +4 -4
  63. package/build/import/type/partial/partial.d.mts +2 -3
  64. package/build/import/type/partial/partial.mjs +8 -21
  65. package/build/import/type/pick/index.d.mts +1 -0
  66. package/build/import/type/pick/index.mjs +1 -0
  67. package/build/import/type/pick/pick-from-mapped-key.mjs +4 -5
  68. package/build/import/type/pick/pick-from-mapped-result.d.mts +11 -0
  69. package/build/import/type/pick/pick-from-mapped-result.mjs +17 -0
  70. package/build/import/type/pick/pick.d.mts +5 -2
  71. package/build/import/type/pick/pick.mjs +11 -10
  72. package/build/import/type/promise/promise.mjs +1 -1
  73. package/build/import/type/readonly/readonly-from-mapped-result.d.mts +5 -5
  74. package/build/import/type/readonly/readonly-from-mapped-result.mjs +4 -4
  75. package/build/import/type/record/record.d.mts +2 -2
  76. package/build/import/type/record/record.mjs +3 -0
  77. package/build/import/type/ref/ref.mjs +1 -1
  78. package/build/import/type/required/required-from-mapped-result.d.mts +5 -5
  79. package/build/import/type/required/required-from-mapped-result.mjs +7 -7
  80. package/build/import/type/required/required.d.mts +2 -3
  81. package/build/import/type/required/required.mjs +4 -14
  82. package/build/import/type/rest/rest.d.mts +2 -2
  83. package/build/import/type/rest/rest.mjs +1 -2
  84. package/build/import/type/sets/index.d.mts +1 -0
  85. package/build/import/type/sets/index.mjs +1 -0
  86. package/build/import/type/sets/set.d.mts +24 -0
  87. package/build/import/type/sets/set.mjs +35 -0
  88. package/build/import/type/strict/strict.d.mts +1 -1
  89. package/build/import/type/strict/strict.mjs +1 -1
  90. package/build/import/type/template-literal/syntax.d.mts +1 -1
  91. package/build/import/type/template-literal/template-literal.d.mts +1 -1
  92. package/build/import/type/transform/transform.mjs +1 -1
  93. package/build/import/type/type/json.d.mts +6 -2
  94. package/build/import/type/union/union-evaluated.mjs +3 -14
  95. package/build/require/index.d.ts +2 -2
  96. package/build/require/type/awaited/awaited.js +2 -6
  97. package/build/require/type/composite/composite.d.ts +1 -2
  98. package/build/require/type/composite/composite.js +5 -6
  99. package/build/require/type/const/const.js +6 -6
  100. package/build/require/type/constructor/constructor.d.ts +1 -1
  101. package/build/require/type/constructor/constructor.js +1 -1
  102. package/build/require/type/deref/deref.js +0 -1
  103. package/build/require/type/discard/discard.js +2 -2
  104. package/build/require/type/enum/enum.js +3 -0
  105. package/build/require/type/exclude/exclude-from-mapped-result.d.ts +5 -5
  106. package/build/require/type/exclude/exclude-from-mapped-result.js +7 -7
  107. package/build/require/type/exclude/exclude.js +0 -1
  108. package/build/require/type/extends/extends-from-mapped-key.d.ts +1 -1
  109. package/build/require/type/extends/extends-from-mapped-key.js +4 -5
  110. package/build/require/type/extends/extends-from-mapped-result.d.ts +5 -5
  111. package/build/require/type/extends/extends-from-mapped-result.js +7 -7
  112. package/build/require/type/extends/extends.js +0 -1
  113. package/build/require/type/extract/extract-from-mapped-result.d.ts +5 -5
  114. package/build/require/type/extract/extract-from-mapped-result.js +7 -7
  115. package/build/require/type/extract/extract.d.ts +1 -2
  116. package/build/require/type/extract/extract.js +4 -3
  117. package/build/require/type/index.d.ts +1 -1
  118. package/build/require/type/index.js +1 -1
  119. package/build/require/type/indexed/indexed-from-mapped-key.d.ts +2 -2
  120. package/build/require/type/indexed/indexed-from-mapped-key.js +4 -5
  121. package/build/require/type/indexed/indexed-from-mapped-result.d.ts +1 -1
  122. package/build/require/type/indexed/indexed-property-keys.d.ts +6 -6
  123. package/build/require/type/indexed/indexed-property-keys.js +3 -5
  124. package/build/require/type/indexed/indexed.d.ts +1 -1
  125. package/build/require/type/indexed/indexed.js +9 -27
  126. package/build/require/type/intersect/intersect-evaluated.js +3 -13
  127. package/build/require/type/intrinsic/capitalize.d.ts +2 -2
  128. package/build/require/type/intrinsic/intrinsic-from-mapped-key.d.ts +1 -1
  129. package/build/require/type/intrinsic/intrinsic-from-mapped-key.js +4 -5
  130. package/build/require/type/intrinsic/intrinsic.d.ts +2 -3
  131. package/build/require/type/intrinsic/intrinsic.js +2 -5
  132. package/build/require/type/intrinsic/lowercase.d.ts +2 -2
  133. package/build/require/type/intrinsic/uncapitalize.d.ts +2 -2
  134. package/build/require/type/intrinsic/uppercase.d.ts +2 -2
  135. package/build/require/type/iterator/iterator.js +1 -1
  136. package/build/require/type/keyof/keyof-from-mapped-result.d.ts +3 -3
  137. package/build/require/type/keyof/keyof-from-mapped-result.js +4 -4
  138. package/build/require/type/keyof/keyof-property-keys.d.ts +3 -3
  139. package/build/require/type/keyof/keyof-property-keys.js +9 -15
  140. package/build/require/type/keyof/keyof.js +2 -8
  141. package/build/require/type/mapped/mapped.d.ts +6 -1
  142. package/build/require/type/mapped/mapped.js +21 -14
  143. package/build/require/type/not/not.js +1 -1
  144. package/build/require/type/object/object.d.ts +1 -1
  145. package/build/require/type/object/object.js +0 -1
  146. package/build/require/type/omit/index.d.ts +1 -0
  147. package/build/require/type/omit/index.js +1 -0
  148. package/build/require/type/omit/omit-from-mapped-key.js +4 -5
  149. package/build/require/type/omit/omit-from-mapped-result.d.ts +11 -0
  150. package/build/require/type/omit/omit-from-mapped-result.js +22 -0
  151. package/build/require/type/omit/omit.d.ts +6 -3
  152. package/build/require/type/omit/omit.js +10 -8
  153. package/build/require/type/optional/optional-from-mapped-result.d.ts +5 -5
  154. package/build/require/type/optional/optional-from-mapped-result.js +7 -7
  155. package/build/require/type/partial/partial-from-mapped-result.d.ts +5 -5
  156. package/build/require/type/partial/partial-from-mapped-result.js +4 -4
  157. package/build/require/type/partial/partial.d.ts +2 -3
  158. package/build/require/type/partial/partial.js +8 -21
  159. package/build/require/type/pick/index.d.ts +1 -0
  160. package/build/require/type/pick/index.js +1 -0
  161. package/build/require/type/pick/pick-from-mapped-key.js +4 -5
  162. package/build/require/type/pick/pick-from-mapped-result.d.ts +11 -0
  163. package/build/require/type/pick/pick-from-mapped-result.js +22 -0
  164. package/build/require/type/pick/pick.d.ts +5 -2
  165. package/build/require/type/pick/pick.js +10 -9
  166. package/build/require/type/promise/promise.js +1 -1
  167. package/build/require/type/readonly/readonly-from-mapped-result.d.ts +5 -5
  168. package/build/require/type/readonly/readonly-from-mapped-result.js +4 -4
  169. package/build/require/type/record/record.d.ts +2 -2
  170. package/build/require/type/record/record.js +3 -0
  171. package/build/require/type/ref/ref.js +1 -1
  172. package/build/require/type/required/required-from-mapped-result.d.ts +5 -5
  173. package/build/require/type/required/required-from-mapped-result.js +7 -7
  174. package/build/require/type/required/required.d.ts +2 -3
  175. package/build/require/type/required/required.js +4 -14
  176. package/build/require/type/rest/rest.d.ts +2 -2
  177. package/build/require/type/rest/rest.js +1 -3
  178. package/build/require/type/sets/index.d.ts +1 -0
  179. package/build/require/type/{operators → sets}/index.js +1 -1
  180. package/build/require/type/sets/set.d.ts +24 -0
  181. package/build/require/type/sets/set.js +47 -0
  182. package/build/require/type/strict/strict.d.ts +1 -1
  183. package/build/require/type/strict/strict.js +1 -1
  184. package/build/require/type/template-literal/parse.js +1 -1
  185. package/build/require/type/template-literal/syntax.d.ts +1 -1
  186. package/build/require/type/template-literal/template-literal.d.ts +1 -1
  187. package/build/require/type/transform/transform.js +1 -1
  188. package/build/require/type/type/json.d.ts +6 -2
  189. package/build/require/type/union/union-evaluated.js +3 -14
  190. package/package.json +1 -1
  191. package/readme.md +64 -64
  192. package/build/import/type/operators/index.d.mts +0 -1
  193. package/build/import/type/operators/index.mjs +0 -1
  194. package/build/import/type/operators/operators.d.mts +0 -24
  195. package/build/import/type/operators/operators.mjs +0 -77
  196. package/build/require/type/operators/index.d.ts +0 -1
  197. package/build/require/type/operators/operators.d.ts +0 -24
  198. package/build/require/type/operators/operators.js +0 -89
@@ -11,12 +11,12 @@ function FromProperties(K, F) {
11
11
  }, {});
12
12
  }
13
13
  // prettier-ignore
14
- function FromMappedResult(K, F) {
15
- return FromProperties(K.properties, F);
14
+ function FromMappedResult(R, F) {
15
+ return FromProperties(R.properties, F);
16
16
  }
17
17
  // prettier-ignore
18
- function ReadonlyFromMappedResult(T, F) {
19
- const P = FromMappedResult(T, F);
18
+ function ReadonlyFromMappedResult(R, F) {
19
+ const P = FromMappedResult(R, F);
20
20
  return (0, index_1.MappedResult)(P);
21
21
  }
22
22
  exports.ReadonlyFromMappedResult = ReadonlyFromMappedResult;
@@ -2,14 +2,14 @@ import type { TSchema } from '../schema/index';
2
2
  import type { Static } from '../static/index';
3
3
  import type { Evaluate, Ensure, Assert } from '../helpers/index';
4
4
  import { type TObject, type TProperties, type TAdditionalProperties, type ObjectOptions } from '../object/index';
5
- import { type TLiteral, TLiteralValue } from '../literal/index';
5
+ import { type TLiteral, type TLiteralValue } from '../literal/index';
6
6
  import { type TNever } from '../never/index';
7
7
  import { type TUnion } from '../union/index';
8
8
  import { type TString } from '../string/index';
9
9
  import { type TInteger } from '../integer/index';
10
10
  import { type TNumber } from '../number/index';
11
11
  import { type TEnum } from '../enum/index';
12
- import { TTemplateLiteral, TIsTemplateLiteralFinite } from '../template-literal/index';
12
+ import { TIsTemplateLiteralFinite, type TTemplateLiteral } from '../template-literal/index';
13
13
  import { Kind } from '../symbols/index';
14
14
  type TFromTemplateLiteralKeyInfinite<K extends TTemplateLiteral, T extends TSchema> = Ensure<TRecord<K, T>>;
15
15
  type TFromTemplateLiteralKeyFinite<K extends TTemplateLiteral, T extends TSchema, I extends string = Static<K>> = (Ensure<TObject<Evaluate<{
@@ -10,6 +10,9 @@ const index_5 = require("../patterns/index");
10
10
  const index_6 = require("../indexed/index");
11
11
  const index_7 = require("../symbols/index");
12
12
  const type_1 = require("../clone/type");
13
+ // ------------------------------------------------------------------
14
+ // ValueGuard
15
+ // ------------------------------------------------------------------
13
16
  const value_1 = require("../guard/value");
14
17
  // ------------------------------------------------------------------
15
18
  // TypeGuard
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Ref = void 0;
5
5
  const index_1 = require("../symbols/index");
6
6
  // ------------------------------------------------------------------
7
- // TypeGuard
7
+ // ValueGuard
8
8
  // ------------------------------------------------------------------
9
9
  const value_1 = require("../guard/value");
10
10
  /** `[Json]` Creates a Ref type. */
@@ -2,10 +2,10 @@ import type { SchemaOptions } from '../schema/index';
2
2
  import type { TProperties } from '../object/index';
3
3
  import { type TMappedResult } from '../mapped/index';
4
4
  import { type TRequired } from './required';
5
- type TFromProperties<K extends TProperties> = ({
6
- [K2 in keyof K]: TRequired<K[K2]>;
5
+ type TFromProperties<P extends TProperties> = ({
6
+ [K2 in keyof P]: TRequired<P[K2]>;
7
7
  });
8
- type TFromMappedResult<K extends TMappedResult> = (TFromProperties<K['properties']>);
9
- export type TRequiredFromMappedResult<T extends TMappedResult, P extends TProperties = TFromMappedResult<T>> = (TMappedResult<P>);
10
- export declare function RequiredFromMappedResult<T extends TMappedResult, P extends TProperties = TFromMappedResult<T>>(T: T, options: SchemaOptions): TMappedResult<P>;
8
+ type TFromMappedResult<R extends TMappedResult> = (TFromProperties<R['properties']>);
9
+ export type TRequiredFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>> = (TMappedResult<P>);
10
+ export declare function RequiredFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>>(R: R, options: SchemaOptions): TMappedResult<P>;
11
11
  export {};
@@ -5,18 +5,18 @@ exports.RequiredFromMappedResult = void 0;
5
5
  const index_1 = require("../mapped/index");
6
6
  const required_1 = require("./required");
7
7
  // prettier-ignore
8
- function FromProperties(K, options) {
9
- return globalThis.Object.getOwnPropertyNames(K).reduce((Acc, K2) => {
10
- return { ...Acc, [K2]: (0, required_1.Required)(K[K2], options) };
8
+ function FromProperties(P, options) {
9
+ return globalThis.Object.getOwnPropertyNames(P).reduce((Acc, K2) => {
10
+ return { ...Acc, [K2]: (0, required_1.Required)(P[K2], options) };
11
11
  }, {});
12
12
  }
13
13
  // prettier-ignore
14
- function FromMappedResult(K, options) {
15
- return FromProperties(K.properties, options);
14
+ function FromMappedResult(R, options) {
15
+ return FromProperties(R.properties, options);
16
16
  }
17
17
  // prettier-ignore
18
- function RequiredFromMappedResult(T, options) {
19
- const P = FromMappedResult(T, options);
18
+ function RequiredFromMappedResult(R, options) {
19
+ const P = FromMappedResult(R, options);
20
20
  return (0, index_1.MappedResult)(P);
21
21
  }
22
22
  exports.RequiredFromMappedResult = RequiredFromMappedResult;
@@ -9,12 +9,11 @@ import { type TIntersect } from '../intersect/index';
9
9
  import { type TUnion } from '../union/index';
10
10
  import { type TObject, type TProperties } from '../object/index';
11
11
  import { type TRequiredFromMappedResult } from './required-from-mapped-result';
12
- type TFromIntersect<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromIntersect<R, [...Acc, TRequiredResolve<L>]> : Acc);
13
- type TFromUnion<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromUnion<R, [...Acc, TRequiredResolve<L>]> : Acc);
12
+ type TFromRest<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Acc, TRequiredResolve<L>]> : Acc);
14
13
  type TFromProperties<T extends TProperties> = Evaluate<{
15
14
  [K in keyof T]: T[K] extends (TReadonlyOptional<infer S>) ? TReadonly<S> : T[K] extends (TReadonly<infer S>) ? TReadonly<S> : T[K] extends (TOptional<infer S>) ? S : T[K];
16
15
  }>;
17
- type TRequiredResolve<T extends TSchema> = (T extends TRecursive<infer S> ? TRecursive<TRequiredResolve<S>> : T extends TIntersect<infer S> ? TIntersect<TFromIntersect<S>> : T extends TUnion<infer S> ? TUnion<TFromUnion<S>> : T extends TObject<infer S> ? TObject<TFromProperties<S>> : TObject<{}>);
16
+ type TRequiredResolve<T extends TSchema> = (T extends TRecursive<infer S> ? TRecursive<TRequiredResolve<S>> : T extends TIntersect<infer S> ? TIntersect<TFromRest<S>> : T extends TUnion<infer S> ? TUnion<TFromRest<S>> : T extends TObject<infer S> ? TObject<TFromProperties<S>> : TObject<{}>);
18
17
  export type TRequired<T extends TSchema> = TRequiredResolve<T>;
19
18
  /** `[Json]` Constructs a type where all properties are required */
20
19
  export declare function Required<T extends TMappedResult>(T: T, options?: SchemaOptions): TRequiredFromMappedResult<T>;
@@ -14,18 +14,8 @@ const required_from_mapped_result_1 = require("./required-from-mapped-result");
14
14
  // ------------------------------------------------------------------
15
15
  const type_2 = require("../guard/type");
16
16
  // prettier-ignore
17
- function FromIntersect(T, Acc = []) {
18
- const [L, ...R] = T;
19
- return (T.length > 0
20
- ? FromIntersect(R, [...Acc, RequiredResolve(L)])
21
- : Acc);
22
- }
23
- // prettier-ignore
24
- function FromUnion(T, Acc = []) {
25
- const [L, ...R] = T;
26
- return (T.length > 0
27
- ? FromUnion(R, [...Acc, RequiredResolve(L)])
28
- : Acc);
17
+ function FromRest(T) {
18
+ return T.map(L => RequiredResolve(L));
29
19
  }
30
20
  // prettier-ignore
31
21
  function FromProperties(T) {
@@ -35,8 +25,8 @@ function FromProperties(T) {
35
25
  }
36
26
  // prettier-ignore
37
27
  function RequiredResolve(T) {
38
- return ((0, type_2.IsIntersect)(T) ? (0, index_1.Intersect)(FromIntersect(T.allOf)) :
39
- (0, type_2.IsUnion)(T) ? (0, index_2.Union)(FromUnion(T.anyOf)) :
28
+ return ((0, type_2.IsIntersect)(T) ? (0, index_1.Intersect)(FromRest(T.allOf)) :
29
+ (0, type_2.IsUnion)(T) ? (0, index_2.Union)(FromRest(T.anyOf)) :
40
30
  (0, type_2.IsObject)(T) ? (0, index_3.Object)(FromProperties(T.properties)) :
41
31
  (0, index_3.Object)({}));
42
32
  }
@@ -2,9 +2,9 @@ import type { TSchema } from '../schema/index';
2
2
  import type { TIntersect } from '../intersect/index';
3
3
  import type { TUnion } from '../union/index';
4
4
  import type { TTuple } from '../tuple/index';
5
- export type TRestResolve<T extends TSchema> = T extends TIntersect<infer S> ? [...S] : T extends TUnion<infer S> ? [...S] : T extends TTuple<infer S> ? [...S] : [
5
+ type TRestResolve<T extends TSchema> = T extends TIntersect<infer S> ? [...S] : T extends TUnion<infer S> ? [...S] : T extends TTuple<infer S> ? [...S] : [
6
6
  ];
7
- export declare function RestResolve<T extends TSchema>(T: T): TRestResolve<T>;
8
7
  export type TRest<T extends TSchema> = TRestResolve<T>;
9
8
  /** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */
10
9
  export declare function Rest<T extends TSchema>(T: T): TRest<T>;
10
+ export {};
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Rest = exports.RestResolve = void 0;
4
+ exports.Rest = void 0;
5
5
  const type_1 = require("../clone/type");
6
6
  // ------------------------------------------------------------------
7
7
  // TypeGuard
8
8
  // ------------------------------------------------------------------
9
- // prettier-ignore
10
9
  const type_2 = require("../guard/type");
11
10
  // prettier-ignore
12
11
  function RestResolve(T) {
@@ -15,7 +14,6 @@ function RestResolve(T) {
15
14
  (0, type_2.IsTuple)(T) ? [...(T.items ?? [])] :
16
15
  []);
17
16
  }
18
- exports.RestResolve = RestResolve;
19
17
  /** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */
20
18
  function Rest(T) {
21
19
  return (0, type_1.CloneRest)(RestResolve(T));
@@ -0,0 +1 @@
1
+ export * from './set';
@@ -15,4 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- __exportStar(require("./operators"), exports);
18
+ __exportStar(require("./set"), exports);
@@ -0,0 +1,24 @@
1
+ export type TSetIncludes<T extends PropertyKey[], S extends PropertyKey> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? S extends L ? true : TSetIncludes<R, S> : false);
2
+ /** Returns true if element S is in the set of T */
3
+ export declare function SetIncludes<T extends PropertyKey[], S extends PropertyKey>(T: [...T], S: S): TSetIncludes<T, S>;
4
+ export type SetIsSubset<T extends PropertyKey[], S extends PropertyKey[]> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? SetIsSubset<R, S> : false : true);
5
+ /** Returns true if T is a subset of S */
6
+ export declare function SetIsSubset<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): SetIsSubset<T, S>;
7
+ export type TSetDistinct<T extends PropertyKey[], Acc extends PropertyKey[] = []> = T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<Acc, L> extends false ? TSetDistinct<R, [...Acc, L]> : TSetDistinct<R, [...Acc]> : Acc;
8
+ /** Returns a distinct set of elements */
9
+ export declare function SetDistinct<T extends PropertyKey[]>(T: [...T]): TSetDistinct<T>;
10
+ export type TSetIntersect<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetIntersect<R, S, [L, ...Acc]> : TSetIntersect<R, S, [...Acc]> : Acc);
11
+ /** Returns the Intersect of the given sets */
12
+ export declare function SetIntersect<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetIntersect<T, S>;
13
+ export type TSetUnion<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = S> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetUnion<R, S, [...Acc, L]> : Acc);
14
+ /** Returns the Union of the given sets */
15
+ export declare function SetUnion<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetUnion<T, S>;
16
+ export type TSetComplement<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetComplement<R, S, [...Acc]> : TSetComplement<R, S, [...Acc, L]> : Acc);
17
+ /** Returns the Complement by omitting elements in T that are in S */
18
+ export declare function SetComplement<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetComplement<T, S>;
19
+ export type TSetIntersectMany<T extends PropertyKey[][], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey[]] ? L : T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectMany<R, TSetIntersect<Acc, L>> : Acc);
20
+ /** Returns the Intersect of multiple sets */
21
+ export declare function SetIntersectMany<T extends PropertyKey[][]>(T: [...T]): TSetIntersectMany<T>;
22
+ export type TSetUnionMany<T extends PropertyKey[][], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetUnionMany<R, TSetUnion<Acc, L>> : Acc);
23
+ /** Returns the Union of multiple sets */
24
+ export declare function SetUnionMany<T extends PropertyKey[][]>(T: [...T]): TSetUnionMany<T>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SetUnionMany = exports.SetIntersectMany = exports.SetComplement = exports.SetUnion = exports.SetIntersect = exports.SetDistinct = exports.SetIsSubset = exports.SetIncludes = void 0;
5
+ /** Returns true if element S is in the set of T */
6
+ // prettier-ignore
7
+ function SetIncludes(T, S) {
8
+ return T.includes(S);
9
+ }
10
+ exports.SetIncludes = SetIncludes;
11
+ /** Returns true if T is a subset of S */
12
+ function SetIsSubset(T, S) {
13
+ return T.every((L) => SetIncludes(S, L));
14
+ }
15
+ exports.SetIsSubset = SetIsSubset;
16
+ /** Returns a distinct set of elements */
17
+ function SetDistinct(T) {
18
+ return [...new Set(T)];
19
+ }
20
+ exports.SetDistinct = SetDistinct;
21
+ /** Returns the Intersect of the given sets */
22
+ function SetIntersect(T, S) {
23
+ return T.filter((L) => S.includes(L));
24
+ }
25
+ exports.SetIntersect = SetIntersect;
26
+ /** Returns the Union of the given sets */
27
+ function SetUnion(T, S) {
28
+ return [...T, ...S];
29
+ }
30
+ exports.SetUnion = SetUnion;
31
+ /** Returns the Complement by omitting elements in T that are in S */
32
+ // prettier-ignore
33
+ function SetComplement(T, S) {
34
+ return T.filter(L => !S.includes(L));
35
+ }
36
+ exports.SetComplement = SetComplement;
37
+ /** Returns the Intersect of multiple sets */
38
+ // prettier-ignore
39
+ function SetIntersectMany(T) {
40
+ return (T.length === 1 ? T[0] : T.reduce((Acc, L) => [...SetIntersect(Acc, L)], []));
41
+ }
42
+ exports.SetIntersectMany = SetIntersectMany;
43
+ /** Returns the Union of multiple sets */
44
+ function SetUnionMany(T) {
45
+ return T.reduce((Acc, L) => [...Acc, ...L], []);
46
+ }
47
+ exports.SetUnionMany = SetUnionMany;
@@ -1,3 +1,3 @@
1
1
  import type { TSchema } from '../schema/index';
2
- /** `[Json]` Omits compositing symbols from this schema */
2
+ /** `[Json]` Omits compositing symbols from this schema. */
3
3
  export declare function Strict<T extends TSchema>(schema: T): T;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Strict = void 0;
5
- /** `[Json]` Omits compositing symbols from this schema */
5
+ /** `[Json]` Omits compositing symbols from this schema. */
6
6
  function Strict(schema) {
7
7
  return JSON.parse(JSON.stringify(schema));
8
8
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.TemplateLiteralParseExact = exports.TemplateLiteralParse = exports.TemplateLiteralParserError = void 0;
4
-
5
5
  const index_1 = require("../error/index");
6
6
  // ------------------------------------------------------------------
7
7
  // TemplateLiteralParserError
@@ -1,5 +1,5 @@
1
1
  import type { Assert, Trim } from '../helpers/index';
2
- import type { TTemplateLiteralKind, TTemplateLiteral } from './index';
2
+ import type { TTemplateLiteral, TTemplateLiteralKind } from './index';
3
3
  import { type TLiteral } from '../literal/index';
4
4
  import { type TBoolean } from '../boolean/index';
5
5
  import { type TBigInt } from '../bigint/index';
@@ -9,7 +9,7 @@ import type { TString } from '../string/index';
9
9
  import type { TBoolean } from '../boolean/index';
10
10
  import type { TNever } from '../never/index';
11
11
  import type { Static } from '../static/index';
12
- import { TTemplateLiteralSyntax } from './syntax';
12
+ import { type TTemplateLiteralSyntax } from './syntax';
13
13
  import { EmptyString } from '../helpers/index';
14
14
  import { Kind } from '../symbols/index';
15
15
  type TemplateLiteralStaticKind<T, Acc extends string> = T extends TUnion<infer U> ? {
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Transform = exports.TransformEncodeBuilder = exports.TransformDecodeBuilder = void 0;
5
- const type_1 = require("../clone/type");
6
5
  const index_1 = require("../symbols/index");
6
+ const type_1 = require("../clone/type");
7
7
  // ------------------------------------------------------------------
8
8
  // TypeGuard
9
9
  // ------------------------------------------------------------------
@@ -21,10 +21,10 @@ import { type TNull } from '../null/index';
21
21
  import { type TMappedKey } from '../mapped/index';
22
22
  import { type TNumber, type NumberOptions } from '../number/index';
23
23
  import { type TObject, type TProperties, type ObjectOptions } from '../object/index';
24
- import { type TOmit, type TOmitFromMappedKey } from '../omit/index';
24
+ import { type TOmit, type TOmitFromMappedKey, type TOmitFromMappedResult } from '../omit/index';
25
25
  import { type TOptionalWithFlag, type TOptionalFromMappedResult } from '../optional/index';
26
26
  import { type TPartial, type TPartialFromMappedResult } from '../partial/index';
27
- import { type TPick, type TPickFromMappedKey } from '../pick/index';
27
+ import { type TPick, type TPickFromMappedKey, type TPickFromMappedResult } from '../pick/index';
28
28
  import { type TReadonlyWithFlag, type TReadonlyFromMappedResult } from '../readonly/index';
29
29
  import { type TReadonlyOptional } from '../readonly-optional/index';
30
30
  import { type TRecordOrObject } from '../record/index';
@@ -127,6 +127,8 @@ export declare class JsonTypeBuilder {
127
127
  /** `[Json]` Creates an Object type */
128
128
  Object<T extends TProperties>(properties: T, options?: ObjectOptions): TObject<T>;
129
129
  /** `[Json]` Constructs a type whose keys are omitted from the given type */
130
+ Omit<T extends TMappedResult, K extends PropertyKey[]>(T: T, K: [...K], options?: SchemaOptions): TOmitFromMappedResult<T, K>;
131
+ /** `[Json]` Constructs a type whose keys are omitted from the given type */
130
132
  Omit<T extends TSchema, K extends TMappedKey>(T: T, K: K): TOmitFromMappedKey<T, K>;
131
133
  /** `[Json]` Constructs a type whose keys are omitted from the given type */
132
134
  Omit<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
@@ -137,6 +139,8 @@ export declare class JsonTypeBuilder {
137
139
  /** `[Json]` Constructs a type where all properties are optional */
138
140
  Partial<T extends TSchema>(schema: T, options?: ObjectOptions): TPartial<T>;
139
141
  /** `[Json]` Constructs a type whose keys are picked from the given type */
142
+ Pick<T extends TMappedResult, K extends PropertyKey[]>(T: T, K: [...K]): TPickFromMappedResult<T, K>;
143
+ /** `[Json]` Constructs a type whose keys are picked from the given type */
140
144
  Pick<T extends TSchema, K extends TMappedKey>(T: T, K: K): TPickFromMappedKey<T, K>;
141
145
  /** `[Json]` Constructs a type whose keys are picked from the given type */
142
146
  Pick<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
@@ -11,25 +11,14 @@ const union_create_1 = require("./union-create");
11
11
  // ------------------------------------------------------------------
12
12
  // TypeGuard
13
13
  // ------------------------------------------------------------------
14
- // prettier-ignore
15
14
  const type_2 = require("../guard/type");
16
15
  // prettier-ignore
17
16
  function IsUnionOptional(T) {
18
- const [L, ...R] = T;
19
- return (T.length > 0
20
- ? (0, type_2.IsOptional)(L)
21
- ? true
22
- : IsUnionOptional(R)
23
- : false);
17
+ return T.some(L => (0, type_2.IsOptional)(L));
24
18
  }
25
19
  // prettier-ignore
26
- function RemoveOptionalFromRest(T, Acc = []) {
27
- const [L, ...R] = T;
28
- return (T.length > 0
29
- ? (0, type_2.IsOptional)(L)
30
- ? RemoveOptionalFromRest(R, [...Acc, RemoveOptionalFromType(L)])
31
- : RemoveOptionalFromRest(R, [...Acc, L])
32
- : Acc);
20
+ function RemoveOptionalFromRest(T) {
21
+ return T.map(L => (0, type_2.IsOptional)(L) ? RemoveOptionalFromType(L) : L);
33
22
  }
34
23
  // prettier-ignore
35
24
  function RemoveOptionalFromType(T) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sinclair/typebox",
3
- "version": "0.32.0-dev-26",
3
+ "version": "0.32.0-dev-27",
4
4
  "description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",
package/readme.md CHANGED
@@ -53,7 +53,7 @@ type T = Static<typeof T> // type T = {
53
53
 
54
54
  TypeBox is a runtime type builder that creates in-memory Json Schema objects that infer as TypeScript types. The schematics produced by this library are designed to match the static type checking rules of the TypeScript compiler. TypeBox offers a unified type that can be statically checked by TypeScript and runtime asserted using standard Json Schema validation.
55
55
 
56
- This library is designed to be a runtime type system with capabilities similar to TypeScript's static type system. It can be used as a simple tool to build up complex schematics or integrated into REST and RPC services to help validate data received over the wire.
56
+ This library is built to be a runtime type system offering similar capabilities to TypeScript's static type system. It can be used as a simple tool to build up complex schematics or integrated into REST and RPC services to help validate data received over the wire.
57
57
 
58
58
  License MIT
59
59
 
@@ -1709,35 +1709,35 @@ This benchmark measures compilation performance for varying types.
1709
1709
  ┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┐
1710
1710
  │ (index) │ Iterations │ Ajv │ TypeCompiler │ Performance │
1711
1711
  ├────────────────────────────┼────────────┼──────────────┼──────────────┼──────────────┤
1712
- │ Literal_String │ 1000 │ ' 236 ms' │ ' 9 ms' │ ' 26.22 x' │
1713
- │ Literal_Number │ 1000 │ ' 205 ms' │ ' 13 ms' │ ' 15.77 x' │
1714
- │ Literal_Boolean │ 1000 │ ' 168 ms' │ ' 4 ms' │ ' 42.00 x' │
1715
- │ Primitive_Number │ 1000 │ ' 170 ms' │ ' 8 ms' │ ' 21.25 x' │
1716
- │ Primitive_String │ 1000 │ ' 162 ms' │ ' 7 ms' │ ' 23.14 x' │
1717
- │ Primitive_String_Pattern │ 1000 │ ' 211 ms' │ ' 10 ms' │ ' 21.10 x' │
1718
- │ Primitive_Boolean │ 1000 │ ' 139 ms' │ ' 4 ms' │ ' 34.75 x' │
1719
- │ Primitive_Null │ 1000 │ ' 146 ms' │ ' 5 ms' │ ' 29.20 x' │
1720
- │ Object_Unconstrained │ 1000 │ ' 1160 ms' │ ' 33 ms' │ ' 35.15 x' │
1721
- │ Object_Constrained │ 1000 │ ' 1257 ms' │ ' 26 ms' │ ' 48.35 x' │
1722
- │ Object_Vector3 │ 1000 │ ' 393 ms' │ ' 8 ms' │ ' 49.13 x' │
1723
- │ Object_Box3D │ 1000 │ ' 1795 ms' │ ' 30 ms' │ ' 59.83 x' │
1724
- │ Tuple_Primitive │ 1000 │ ' 542 ms' │ ' 16 ms' │ ' 33.88 x' │
1725
- │ Tuple_Object │ 1000 │ ' 1330 ms' │ ' 17 ms' │ ' 78.24 x' │
1726
- │ Composite_Intersect │ 1000 │ ' 624 ms' │ ' 17 ms' │ ' 36.71 x' │
1727
- │ Composite_Union │ 1000 │ ' 565 ms' │ ' 19 ms' │ ' 29.74 x' │
1728
- │ Math_Vector4 │ 1000 │ ' 853 ms' │ ' 10 ms' │ ' 85.30 x' │
1729
- │ Math_Matrix4 │ 1000 │ ' 406 ms' │ ' 12 ms' │ ' 33.83 x' │
1730
- │ Array_Primitive_Number │ 1000 │ ' 401 ms' │ ' 11 ms' │ ' 36.45 x' │
1731
- │ Array_Primitive_String │ 1000 │ ' 385 ms' │ ' 6 ms' │ ' 64.17 x' │
1732
- │ Array_Primitive_Boolean │ 1000 │ ' 347 ms' │ ' 8 ms' │ ' 43.38 x' │
1733
- │ Array_Object_Unconstrained │ 1000 │ ' 1904 ms' │ ' 25 ms' │ ' 76.16 x' │
1734
- │ Array_Object_Constrained │ 1000 │ ' 1582 ms' │ ' 20 ms' │ ' 79.10 x' │
1735
- │ Array_Tuple_Primitive │ 1000 │ ' 864 ms' │ ' 11 ms' │ ' 78.55 x' │
1736
- │ Array_Tuple_Object │ 1000 │ ' 1658 ms' │ ' 16 ms' │ ' 103.63 x' │
1737
- │ Array_Composite_Intersect │ 1000 │ ' 786 ms' │ ' 17 ms' │ ' 46.24 x' │
1738
- │ Array_Composite_Union │ 1000 │ ' 844 ms' │ ' 16 ms' │ ' 52.75 x' │
1739
- │ Array_Math_Vector4 │ 1000 │ ' 1192 ms' │ ' 10 ms' │ ' 119.20 x' │
1740
- │ Array_Math_Matrix4 │ 1000 │ ' 688 ms' │ ' 10 ms' │ ' 68.80 x' │
1712
+ │ Literal_String │ 1000 │ ' 242 ms' │ ' 10 ms' │ ' 24.20 x' │
1713
+ │ Literal_Number │ 1000 │ ' 200 ms' │ ' 8 ms' │ ' 25.00 x' │
1714
+ │ Literal_Boolean │ 1000 │ ' 168 ms' │ ' 6 ms' │ ' 28.00 x' │
1715
+ │ Primitive_Number │ 1000 │ ' 165 ms' │ ' 8 ms' │ ' 20.63 x' │
1716
+ │ Primitive_String │ 1000 │ ' 154 ms' │ ' 6 ms' │ ' 25.67 x' │
1717
+ │ Primitive_String_Pattern │ 1000 │ ' 208 ms' │ ' 14 ms' │ ' 14.86 x' │
1718
+ │ Primitive_Boolean │ 1000 │ ' 142 ms' │ ' 6 ms' │ ' 23.67 x' │
1719
+ │ Primitive_Null │ 1000 │ ' 143 ms' │ ' 6 ms' │ ' 23.83 x' │
1720
+ │ Object_Unconstrained │ 1000 │ ' 1217 ms' │ ' 31 ms' │ ' 39.26 x' │
1721
+ │ Object_Constrained │ 1000 │ ' 1275 ms' │ ' 26 ms' │ ' 49.04 x' │
1722
+ │ Object_Vector3 │ 1000 │ ' 405 ms' │ ' 12 ms' │ ' 33.75 x' │
1723
+ │ Object_Box3D │ 1000 │ ' 1833 ms' │ ' 27 ms' │ ' 67.89 x' │
1724
+ │ Tuple_Primitive │ 1000 │ ' 475 ms' │ ' 13 ms' │ ' 36.54 x' │
1725
+ │ Tuple_Object │ 1000 │ ' 1267 ms' │ ' 30 ms' │ ' 42.23 x' │
1726
+ │ Composite_Intersect │ 1000 │ ' 604 ms' │ ' 18 ms' │ ' 33.56 x' │
1727
+ │ Composite_Union │ 1000 │ ' 545 ms' │ ' 20 ms' │ ' 27.25 x' │
1728
+ │ Math_Vector4 │ 1000 │ ' 829 ms' │ ' 12 ms' │ ' 69.08 x' │
1729
+ │ Math_Matrix4 │ 1000 │ ' 405 ms' │ ' 10 ms' │ ' 40.50 x' │
1730
+ │ Array_Primitive_Number │ 1000 │ ' 372 ms' │ ' 12 ms' │ ' 31.00 x' │
1731
+ │ Array_Primitive_String │ 1000 │ ' 327 ms' │ ' 5 ms' │ ' 65.40 x' │
1732
+ │ Array_Primitive_Boolean │ 1000 │ ' 300 ms' │ ' 4 ms' │ ' 75.00 x' │
1733
+ │ Array_Object_Unconstrained │ 1000 │ ' 1755 ms' │ ' 21 ms' │ ' 83.57 x' │
1734
+ │ Array_Object_Constrained │ 1000 │ ' 1516 ms' │ ' 20 ms' │ ' 75.80 x' │
1735
+ │ Array_Tuple_Primitive │ 1000 │ ' 825 ms' │ ' 14 ms' │ ' 58.93 x' │
1736
+ │ Array_Tuple_Object │ 1000 │ ' 1616 ms' │ ' 16 ms' │ ' 101.00 x' │
1737
+ │ Array_Composite_Intersect │ 1000 │ ' 776 ms' │ ' 16 ms' │ ' 48.50 x' │
1738
+ │ Array_Composite_Union │ 1000 │ ' 820 ms' │ ' 14 ms' │ ' 58.57 x' │
1739
+ │ Array_Math_Vector4 │ 1000 │ ' 1166 ms' │ ' 15 ms' │ ' 77.73 x' │
1740
+ │ Array_Math_Matrix4 │ 1000 │ ' 695 ms' │ ' 8 ms' │ ' 86.88 x' │
1741
1741
  └────────────────────────────┴────────────┴──────────────┴──────────────┴──────────────┘
1742
1742
  ```
1743
1743
 
@@ -1751,37 +1751,37 @@ This benchmark measures validation performance for varying types.
1751
1751
  ┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┬──────────────┐
1752
1752
  │ (index) │ Iterations │ ValueCheck │ Ajv │ TypeCompiler │ Performance │
1753
1753
  ├────────────────────────────┼────────────┼──────────────┼──────────────┼──────────────┼──────────────┤
1754
- │ Literal_String │ 1000000 │ ' 19 ms' │ ' 5 ms' │ ' 4 ms' │ ' 1.25 x' │
1755
- │ Literal_Number │ 1000000 │ ' 14 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │
1756
- │ Literal_Boolean │ 1000000 │ ' 14 ms' │ ' 19 ms' │ ' 9 ms' │ ' 2.11 x' │
1757
- │ Primitive_Number │ 1000000 │ ' 21 ms' │ ' 18 ms' │ ' 10 ms' │ ' 1.80 x' │
1758
- │ Primitive_String │ 1000000 │ ' 22 ms' │ ' 17 ms' │ ' 9 ms' │ ' 1.89 x' │
1759
- │ Primitive_String_Pattern │ 1000000 │ ' 164 ms' │ ' 44 ms' │ ' 36 ms' │ ' 1.22 x' │
1760
- │ Primitive_Boolean │ 1000000 │ ' 18 ms' │ ' 18 ms' │ ' 9 ms' │ ' 2.00 x' │
1754
+ │ Literal_String │ 1000000 │ ' 18 ms' │ ' 5 ms' │ ' 4 ms' │ ' 1.25 x' │
1755
+ │ Literal_Number │ 1000000 │ ' 16 ms' │ ' 18 ms' │ ' 10 ms' │ ' 1.80 x' │
1756
+ │ Literal_Boolean │ 1000000 │ ' 15 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │
1757
+ │ Primitive_Number │ 1000000 │ ' 21 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │
1758
+ │ Primitive_String │ 1000000 │ ' 22 ms' │ ' 18 ms' │ ' 9 ms' │ ' 2.00 x' │
1759
+ │ Primitive_String_Pattern │ 1000000 │ ' 155 ms' │ ' 41 ms' │ ' 34 ms' │ ' 1.21 x' │
1760
+ │ Primitive_Boolean │ 1000000 │ ' 18 ms' │ ' 17 ms' │ ' 9 ms' │ ' 1.89 x' │
1761
1761
  │ Primitive_Null │ 1000000 │ ' 19 ms' │ ' 17 ms' │ ' 9 ms' │ ' 1.89 x' │
1762
- │ Object_Unconstrained │ 1000000 │ ' 966 ms' │ ' 33 ms' │ ' 24 ms' │ ' 1.38 x' │
1763
- │ Object_Constrained │ 1000000 │ ' 1275 ms' │ ' 52 ms' │ ' 42 ms' │ ' 1.24 x' │
1764
- │ Object_Vector3 │ 1000000 │ ' 427 ms' │ ' 23 ms' │ ' 14 ms' │ ' 1.64 x' │
1765
- │ Object_Box3D │ 1000000 │ ' 2024 ms' │ ' 56 ms' │ ' 50 ms' │ ' 1.12 x' │
1766
- │ Object_Recursive │ 1000000 │ ' 5263 ms' │ ' 358 ms' │ ' 164 ms' │ ' 2.18 x' │
1767
- │ Tuple_Primitive │ 1000000 │ ' 157 ms' │ ' 22 ms' │ ' 12 ms' │ ' 1.83 x' │
1768
- │ Tuple_Object │ 1000000 │ ' 767 ms' │ ' 29 ms' │ ' 18 ms' │ ' 1.61 x' │
1769
- │ Composite_Intersect │ 1000000 │ ' 769 ms' │ ' 26 ms' │ ' 15 ms' │ ' 1.73 x' │
1770
- │ Composite_Union │ 1000000 │ ' 501 ms' │ ' 24 ms' │ ' 13 ms' │ ' 1.85 x' │
1771
- │ Math_Vector4 │ 1000000 │ ' 250 ms' │ ' 23 ms' │ ' 11 ms' │ ' 2.09 x' │
1772
- │ Math_Matrix4 │ 1000000 │ ' 1073 ms' │ ' 43 ms' │ ' 28 ms' │ ' 1.54 x' │
1773
- │ Array_Primitive_Number │ 1000000 │ ' 264 ms' │ ' 21 ms' │ ' 12 ms' │ ' 1.75 x' │
1774
- │ Array_Primitive_String │ 1000000 │ ' 242 ms' │ ' 23 ms' │ ' 14 ms' │ ' 1.64 x' │
1775
- │ Array_Primitive_Boolean │ 1000000 │ ' 151 ms' │ ' 24 ms' │ ' 14 ms' │ ' 1.71 x' │
1776
- │ Array_Object_Unconstrained │ 1000000 │ ' 5864 ms' │ ' 66 ms' │ ' 58 ms' │ ' 1.14 x' │
1777
- │ Array_Object_Constrained │ 1000000 │ ' 5996 ms' │ ' 138 ms' │ ' 116 ms' │ ' 1.19 x' │
1778
- │ Array_Object_Recursive │ 1000000 │ ' 22515 ms' │ ' 1625 ms' │ ' 585 ms' │ ' 2.78 x' │
1779
- │ Array_Tuple_Primitive │ 1000000 │ ' 737 ms' │ ' 38 ms' │ ' 31 ms' │ ' 1.23 x' │
1780
- │ Array_Tuple_Object │ 1000000 │ ' 3257 ms' │ ' 77 ms' │ ' 56 ms' │ ' 1.38 x' │
1781
- │ Array_Composite_Intersect │ 1000000 │ ' 3119 ms' │ ' 49 ms' │ ' 38 ms' │ ' 1.29 x' │
1782
- │ Array_Composite_Union │ 1000000 │ ' 2108 ms' │ ' 72 ms' │ ' 33 ms' │ ' 2.18 x' │
1783
- │ Array_Math_Vector4 │ 1000000 │ ' 1078 ms' │ ' 38 ms' │ ' 26 ms' │ ' 1.46 x' │
1784
- │ Array_Math_Matrix4 │ 1000000 │ ' 4967 ms' │ ' 126 ms' │ ' 88 ms' │ ' 1.43 x' │
1762
+ │ Object_Unconstrained │ 1000000 │ ' 1003 ms' │ ' 32 ms' │ ' 24 ms' │ ' 1.33 x' │
1763
+ │ Object_Constrained │ 1000000 │ ' 1265 ms' │ ' 49 ms' │ ' 38 ms' │ ' 1.29 x' │
1764
+ │ Object_Vector3 │ 1000000 │ ' 418 ms' │ ' 22 ms' │ ' 13 ms' │ ' 1.69 x' │
1765
+ │ Object_Box3D │ 1000000 │ ' 2035 ms' │ ' 56 ms' │ ' 49 ms' │ ' 1.14 x' │
1766
+ │ Object_Recursive │ 1000000 │ ' 5243 ms' │ ' 326 ms' │ ' 157 ms' │ ' 2.08 x' │
1767
+ │ Tuple_Primitive │ 1000000 │ ' 153 ms' │ ' 20 ms' │ ' 12 ms' │ ' 1.67 x' │
1768
+ │ Tuple_Object │ 1000000 │ ' 781 ms' │ ' 28 ms' │ ' 18 ms' │ ' 1.56 x' │
1769
+ │ Composite_Intersect │ 1000000 │ ' 742 ms' │ ' 25 ms' │ ' 14 ms' │ ' 1.79 x' │
1770
+ │ Composite_Union │ 1000000 │ ' 558 ms' │ ' 24 ms' │ ' 13 ms' │ ' 1.85 x' │
1771
+ │ Math_Vector4 │ 1000000 │ ' 246 ms' │ ' 22 ms' │ ' 11 ms' │ ' 2.00 x' │
1772
+ │ Math_Matrix4 │ 1000000 │ ' 1052 ms' │ ' 43 ms' │ ' 28 ms' │ ' 1.54 x' │
1773
+ │ Array_Primitive_Number │ 1000000 │ ' 272 ms' │ ' 22 ms' │ ' 12 ms' │ ' 1.83 x' │
1774
+ │ Array_Primitive_String │ 1000000 │ ' 235 ms' │ ' 24 ms' │ ' 14 ms' │ ' 1.71 x' │
1775
+ │ Array_Primitive_Boolean │ 1000000 │ ' 134 ms' │ ' 23 ms' │ ' 14 ms' │ ' 1.64 x' │
1776
+ │ Array_Object_Unconstrained │ 1000000 │ ' 6280 ms' │ ' 65 ms' │ ' 59 ms' │ ' 1.10 x' │
1777
+ │ Array_Object_Constrained │ 1000000 │ ' 6076 ms' │ ' 130 ms' │ ' 119 ms' │ ' 1.09 x' │
1778
+ │ Array_Object_Recursive │ 1000000 │ ' 22738 ms' │ ' 1730 ms' │ ' 635 ms' │ ' 2.72 x' │
1779
+ │ Array_Tuple_Primitive │ 1000000 │ ' 689 ms' │ ' 35 ms' │ ' 30 ms' │ ' 1.17 x' │
1780
+ │ Array_Tuple_Object │ 1000000 │ ' 3266 ms' │ ' 63 ms' │ ' 52 ms' │ ' 1.21 x' │
1781
+ │ Array_Composite_Intersect │ 1000000 │ ' 3310 ms' │ ' 44 ms' │ ' 36 ms' │ ' 1.22 x' │
1782
+ │ Array_Composite_Union │ 1000000 │ ' 2432 ms' │ ' 69 ms' │ ' 33 ms' │ ' 2.09 x' │
1783
+ │ Array_Math_Vector4 │ 1000000 │ ' 1158 ms' │ ' 37 ms' │ ' 24 ms' │ ' 1.54 x' │
1784
+ │ Array_Math_Matrix4 │ 1000000 │ ' 5435 ms' │ ' 132 ms' │ ' 92 ms' │ ' 1.43 x' │
1785
1785
  └────────────────────────────┴────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
1786
1786
  ```
1787
1787
 
@@ -1795,11 +1795,11 @@ The following table lists esbuild compiled and minified sizes for each TypeBox m
1795
1795
  ┌──────────────────────┬────────────┬────────────┬─────────────┐
1796
1796
  │ (index) │ Compiled │ Minified │ Compression │
1797
1797
  ├──────────────────────┼────────────┼────────────┼─────────────┤
1798
- │ typebox/compiler │ '120.7 kb' │ ' 53.0 kb' │ '2.28 x' │
1799
- │ typebox/errors │ ' 55.8 kb' │ ' 25.5 kb' │ '2.19 x' │
1798
+ │ typebox/compiler │ '119.2 kb' │ ' 52.3 kb' │ '2.28 x' │
1799
+ │ typebox/errors │ ' 55.0 kb' │ ' 25.2 kb' │ '2.19 x' │
1800
1800
  │ typebox/system │ ' 4.7 kb' │ ' 2.0 kb' │ '2.33 x' │
1801
- │ typebox/value │ '147.6 kb' │ ' 62.5 kb' │ '2.36 x' │
1802
- │ typebox │ ' 91.3 kb' │ ' 38.0 kb' │ '2.40 x' │
1801
+ │ typebox/value │ '146.1 kb' │ ' 61.8 kb' │ '2.37 x' │
1802
+ │ typebox │ ' 90.1 kb' │ ' 37.3 kb' │ '2.41 x' │
1803
1803
  └──────────────────────┴────────────┴────────────┴─────────────┘
1804
1804
  ```
1805
1805
 
@@ -1 +0,0 @@
1
- export * from './operators.mjs';
@@ -1 +0,0 @@
1
- export * from './operators.mjs';