umt 3.1.0 → 3.2.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.
Files changed (111) hide show
  1. package/module/Validate/any/core.d.ts +2 -1
  2. package/module/Validate/any/core.js +3 -2
  3. package/module/Validate/any/core.js.map +1 -1
  4. package/module/Validate/array/arrayOf.d.ts +2 -1
  5. package/module/Validate/array/arrayOf.js +3 -1
  6. package/module/Validate/array/arrayOf.js.map +1 -1
  7. package/module/Validate/bigint/core.d.ts +2 -1
  8. package/module/Validate/bigint/core.js +3 -1
  9. package/module/Validate/bigint/core.js.map +1 -1
  10. package/module/Validate/boolean/core.d.ts +2 -1
  11. package/module/Validate/boolean/core.js +3 -1
  12. package/module/Validate/boolean/core.js.map +1 -1
  13. package/module/Validate/date/core.d.ts +2 -1
  14. package/module/Validate/date/core.js +3 -1
  15. package/module/Validate/date/core.js.map +1 -1
  16. package/module/Validate/file/core.d.ts +2 -1
  17. package/module/Validate/file/core.js +3 -1
  18. package/module/Validate/file/core.js.map +1 -1
  19. package/module/Validate/function/core.d.ts +2 -1
  20. package/module/Validate/function/core.js +2 -1
  21. package/module/Validate/function/core.js.map +1 -1
  22. package/module/Validate/index.d.ts +1 -0
  23. package/module/Validate/index.js +1 -0
  24. package/module/Validate/index.js.map +1 -1
  25. package/module/Validate/instanceof/core.d.ts +2 -1
  26. package/module/Validate/instanceof/core.js +3 -1
  27. package/module/Validate/instanceof/core.js.map +1 -1
  28. package/module/Validate/map/core.d.ts +2 -1
  29. package/module/Validate/map/core.js +3 -1
  30. package/module/Validate/map/core.js.map +1 -1
  31. package/module/Validate/never/core.d.ts +2 -1
  32. package/module/Validate/never/core.js +7 -8
  33. package/module/Validate/never/core.js.map +1 -1
  34. package/module/Validate/number/core.d.ts +3 -2
  35. package/module/Validate/number/core.js +3 -1
  36. package/module/Validate/number/core.js.map +1 -1
  37. package/module/Validate/object/core.d.ts +2 -1
  38. package/module/Validate/object/core.js +2 -1
  39. package/module/Validate/object/core.js.map +1 -1
  40. package/module/Validate/object/intersection.d.ts +2 -1
  41. package/module/Validate/object/intersection.js +3 -1
  42. package/module/Validate/object/intersection.js.map +1 -1
  43. package/module/Validate/object/nullable.d.ts +2 -1
  44. package/module/Validate/object/nullable.js +2 -1
  45. package/module/Validate/object/nullable.js.map +1 -1
  46. package/module/Validate/object/optional.d.ts +2 -1
  47. package/module/Validate/object/optional.js +2 -1
  48. package/module/Validate/object/optional.js.map +1 -1
  49. package/module/Validate/object/union.d.ts +2 -1
  50. package/module/Validate/object/union.js +3 -1
  51. package/module/Validate/object/union.js.map +1 -1
  52. package/module/Validate/set/core.d.ts +2 -1
  53. package/module/Validate/set/core.js +3 -1
  54. package/module/Validate/set/core.js.map +1 -1
  55. package/module/Validate/standardSchema.d.ts +93 -0
  56. package/module/Validate/standardSchema.js +58 -0
  57. package/module/Validate/standardSchema.js.map +1 -0
  58. package/module/Validate/string/core.d.ts +3 -2
  59. package/module/Validate/string/core.js +5 -1
  60. package/module/Validate/string/core.js.map +1 -1
  61. package/module/Validate/templateLiteral/core.d.ts +2 -1
  62. package/module/Validate/templateLiteral/core.js +3 -1
  63. package/module/Validate/templateLiteral/core.js.map +1 -1
  64. package/module/Validate/unknown/core.d.ts +2 -1
  65. package/module/Validate/unknown/core.js +3 -1
  66. package/module/Validate/unknown/core.js.map +1 -1
  67. package/module/es5/Validate/any/core.d.ts +2 -1
  68. package/module/es5/Validate/any/core.js +3 -2
  69. package/module/es5/Validate/array/arrayOf.d.ts +2 -1
  70. package/module/es5/Validate/array/arrayOf.js +3 -1
  71. package/module/es5/Validate/bigint/core.d.ts +2 -1
  72. package/module/es5/Validate/bigint/core.js +4 -4
  73. package/module/es5/Validate/boolean/core.d.ts +2 -1
  74. package/module/es5/Validate/boolean/core.js +3 -1
  75. package/module/es5/Validate/date/core.d.ts +2 -1
  76. package/module/es5/Validate/date/core.js +3 -1
  77. package/module/es5/Validate/file/core.d.ts +2 -1
  78. package/module/es5/Validate/file/core.js +3 -1
  79. package/module/es5/Validate/function/core.d.ts +2 -1
  80. package/module/es5/Validate/function/core.js +3 -4
  81. package/module/es5/Validate/index.d.ts +1 -0
  82. package/module/es5/Validate/index.js +11 -0
  83. package/module/es5/Validate/instanceof/core.d.ts +2 -1
  84. package/module/es5/Validate/instanceof/core.js +3 -1
  85. package/module/es5/Validate/map/core.d.ts +2 -1
  86. package/module/es5/Validate/map/core.js +4 -4
  87. package/module/es5/Validate/never/core.d.ts +2 -1
  88. package/module/es5/Validate/never/core.js +3 -2
  89. package/module/es5/Validate/number/core.d.ts +3 -2
  90. package/module/es5/Validate/number/core.js +3 -1
  91. package/module/es5/Validate/object/core.d.ts +2 -1
  92. package/module/es5/Validate/object/core.js +2 -1
  93. package/module/es5/Validate/object/intersection.d.ts +2 -1
  94. package/module/es5/Validate/object/intersection.js +3 -1
  95. package/module/es5/Validate/object/nullable.d.ts +2 -1
  96. package/module/es5/Validate/object/nullable.js +2 -1
  97. package/module/es5/Validate/object/optional.d.ts +2 -1
  98. package/module/es5/Validate/object/optional.js +2 -1
  99. package/module/es5/Validate/object/union.d.ts +2 -1
  100. package/module/es5/Validate/object/union.js +3 -1
  101. package/module/es5/Validate/set/core.d.ts +2 -1
  102. package/module/es5/Validate/set/core.js +4 -4
  103. package/module/es5/Validate/standardSchema.d.ts +93 -0
  104. package/module/es5/Validate/standardSchema.js +91 -0
  105. package/module/es5/Validate/string/core.d.ts +3 -2
  106. package/module/es5/Validate/string/core.js +3 -1
  107. package/module/es5/Validate/templateLiteral/core.d.ts +2 -1
  108. package/module/es5/Validate/templateLiteral/core.js +7 -6
  109. package/module/es5/Validate/unknown/core.d.ts +2 -1
  110. package/module/es5/Validate/unknown/core.js +3 -1
  111. package/package.json +9 -9
@@ -1,3 +1,4 @@
1
+ import { attachStandard, } from "../../Validate/standardSchema";
1
2
  /**
2
3
  * Wraps a validator to accept null values
3
4
  * @template T - The type of value the wrapped validator expects
@@ -16,6 +17,6 @@ export const nullable = (validator) => {
16
17
  }
17
18
  return validator(value);
18
19
  };
19
- return nullableValidator;
20
+ return attachStandard(nullableValidator);
20
21
  };
21
22
  //# sourceMappingURL=nullable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../src/Validate/object/nullable.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAItB,SAA0B,EACa,EAAE;IACzC,MAAM,iBAAiB,GAAG,CAAC,KAAe,EAAkB,EAAE;QAC5D,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,IAAI,EAAE,MAAM;aACb,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC"}
1
+ {"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../src/Validate/object/nullable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GAEf,MAAM,2BAA2B,CAAC;AAQnC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAItB,SAA0B,EAEW,EAAE;IACvC,MAAM,iBAAiB,GAAG,CAAC,KAAe,EAAkB,EAAE;QAC5D,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,IAAI,EAAE,MAAM;aACb,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,cAAc,CACnB,iBAAiB,CAClB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { type StandardSchemaV1 } from "../../Validate/standardSchema";
1
2
  export interface UndefinedReturn {
2
3
  validate: boolean;
3
4
  message: string;
@@ -32,4 +33,4 @@ export declare const optional: <T, R extends {
32
33
  type: unknown;
33
34
  message: string;
34
35
  validate: boolean;
35
- }>(validator: (value: T) => R) => OptionalValidator<T, R>;
36
+ }>(validator: (value: T) => R) => OptionalValidator<T, R> & StandardSchemaV1<T | undefined, T | undefined>;
@@ -1,3 +1,4 @@
1
+ import { attachStandard, } from "../../Validate/standardSchema";
1
2
  /**
2
3
  * Wraps a validator to accept undefined values
3
4
  * @template T - The type of value the wrapped validator expects
@@ -18,6 +19,6 @@ export const optional = (validator) => {
18
19
  });
19
20
  optionalValidator.inner = validator;
20
21
  optionalValidator.isOptional = true;
21
- return optionalValidator;
22
+ return attachStandard(optionalValidator);
22
23
  };
23
24
  //# sourceMappingURL=optional.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"optional.js","sourceRoot":"","sources":["../../../src/Validate/object/optional.ts"],"names":[],"mappings":"AAwBA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAItB,SAA0B,EACD,EAAE;IAC3B,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAS,EAAuB,EAAE;QAC5D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,IAAI,EAAE,WAAW;aAClB,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAA4B,CAAC;IAE9B,iBAAiB,CAAC,KAAK,GAAG,SAAS,CAAC;IACpC,iBAAiB,CAAC,UAAU,GAAG,IAAI,CAAC;IAEpC,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC"}
1
+ {"version":3,"file":"optional.js","sourceRoot":"","sources":["../../../src/Validate/object/optional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GAEf,MAAM,2BAA2B,CAAC;AA0BnC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAItB,SAA0B,EACgD,EAAE;IAC5E,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAS,EAAuB,EAAE;QAC5D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,IAAI,EAAE,WAAW;aAClB,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAA4B,CAAC;IAE9B,iBAAiB,CAAC,KAAK,GAAG,SAAS,CAAC;IACpC,iBAAiB,CAAC,UAAU,GAAG,IAAI,CAAC;IAEpC,OAAO,cAAc,CACnB,iBAAiB,CAClB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { type StandardSchemaV1 } from "../../Validate/standardSchema";
1
2
  import type { ValidateCoreReturnType, ValidateType } from "../../Validate/type";
2
3
  export type UnionExtractValidatedType<V> = V extends (value: never) => {
3
4
  type: infer T;
@@ -7,4 +8,4 @@ export type UnionExtractValidatedType<V> = V extends (value: never) => {
7
8
  * @param validators - Validator functions to compose as a union (logical OR)
8
9
  * @returns {Function} - Validator that checks if the value matches any of the validators
9
10
  */
10
- export declare const union: <Vs extends ((value: never) => ValidateCoreReturnType<unknown>)[]>(...validators: [...Vs]) => (value: UnionExtractValidatedType<Vs[number]>) => ValidateCoreReturnType<UnionExtractValidatedType<Vs[number]>>;
11
+ export declare const union: <Vs extends ((value: never) => ValidateCoreReturnType<unknown>)[]>(...validators: [...Vs]) => ((value: UnionExtractValidatedType<Vs[number]>) => ValidateCoreReturnType<UnionExtractValidatedType<Vs[number]>>) & StandardSchemaV1<UnionExtractValidatedType<Vs[number]>, UnionExtractValidatedType<Vs[number]>>;
@@ -1,10 +1,11 @@
1
+ import { attachStandard, } from "../../Validate/standardSchema";
1
2
  /**
2
3
  * Creates a union validator that passes if any of the given validators pass
3
4
  * @param validators - Validator functions to compose as a union (logical OR)
4
5
  * @returns {Function} - Validator that checks if the value matches any of the validators
5
6
  */
6
7
  export const union = (...validators) => {
7
- return (value) => {
8
+ const unionValidator = (value) => {
8
9
  let lastMessage = "";
9
10
  for (const validator of validators) {
10
11
  const result = validator(value);
@@ -23,5 +24,6 @@ export const union = (...validators) => {
23
24
  type: value,
24
25
  };
25
26
  };
27
+ return attachStandard(unionValidator);
26
28
  };
27
29
  //# sourceMappingURL=union.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"union.js","sourceRoot":"","sources":["../../../src/Validate/object/union.ts"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAGnB,GAAG,UAAmB,EACtB,EAAE;IACF,OAAO,CACL,KAA4C,EACmB,EAAE;QACjE,IAAI,WAAW,GAAG,EAAE,CAAC;QACrB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,MAAM,GACV,SAGD,CAAC,KAAK,CAAC,CAAC;YACT,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACpB,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,IAAI,EAAE,KAEL;iBACF,CAAC;YACJ,CAAC;YACD,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,WAAW;YACpB,IAAI,EAAE,KAAgE;SACvE,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"union.js","sourceRoot":"","sources":["../../../src/Validate/object/union.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GAEf,MAAM,2BAA2B,CAAC;AAkBnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAGnB,GAAG,UAAmB,EAOpB,EAAE;IACJ,MAAM,cAAc,GAAG,CACrB,KAA4C,EACmB,EAAE;QACjE,IAAI,WAAW,GAAG,EAAE,CAAC;QACrB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,MAAM,GACV,SAGD,CAAC,KAAK,CAAC,CAAC;YACT,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACpB,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,IAAI,EAAE,KAEL;iBACF,CAAC;YACJ,CAAC;YACD,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,WAAW;YACpB,IAAI,EAAE,KAAgE;SACvE,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,cAAc,CAInB,cAAc,CAAC,CAAC;AACpB,CAAC,CAAC"}
@@ -7,6 +7,7 @@
7
7
  * The function is exported as `set_` because the top-level `Object` module
8
8
  * already exposes a `set` runtime helper.
9
9
  */
10
+ import { type StandardSchemaV1 } from "../../Validate/standardSchema";
10
11
  import type { ValidateCoreReturnType, ValidateType } from "../../Validate/type";
11
12
  export type SetExtractValidatedType<V> = V extends (value: never) => {
12
13
  type: infer T;
@@ -20,4 +21,4 @@ export type SetExtractValidatedType<V> = V extends (value: never) => {
20
21
  * @param {string} [message] - Custom error message for type validation
21
22
  * @returns {Function} - Validator function for Set instances
22
23
  */
23
- export declare const set_: <IV extends (value: any) => ValidateCoreReturnType<unknown> = (value: unknown) => ValidateCoreReturnType<unknown>, T = SetExtractValidatedType<IV>>(itemValidator?: IV, message?: string) => (value: Set<T>) => ValidateCoreReturnType<Set<T>>;
24
+ export declare const set_: <IV extends (value: any) => ValidateCoreReturnType<unknown> = (value: unknown) => ValidateCoreReturnType<unknown>, T = SetExtractValidatedType<IV>>(itemValidator?: IV, message?: string) => ((value: Set<T>) => ValidateCoreReturnType<Set<T>>) & StandardSchemaV1<Set<T>, Set<T>>;
@@ -7,6 +7,7 @@
7
7
  * The function is exported as `set_` because the top-level `Object` module
8
8
  * already exposes a `set` runtime helper.
9
9
  */
10
+ import { attachStandard, } from "../../Validate/standardSchema";
10
11
  /**
11
12
  * Creates a Set validator. When a per-element validator is supplied, every
12
13
  * element of the set must satisfy it; iteration short-circuits at the first
@@ -17,7 +18,7 @@
17
18
  * @returns {Function} - Validator function for Set instances
18
19
  */
19
20
  export const set_ = (itemValidator, message) => {
20
- return (value) => {
21
+ const setValidator = (value) => {
21
22
  if (!(value instanceof Set)) {
22
23
  return {
23
24
  validate: false,
@@ -43,5 +44,6 @@ export const set_ = (itemValidator, message) => {
43
44
  type: value,
44
45
  };
45
46
  };
47
+ return attachStandard(setValidator);
46
48
  };
47
49
  //# sourceMappingURL=core.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/set/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAOlB,aAAkB,EAClB,OAAgB,EAChB,EAAE;IACF,OAAO,CAAC,KAAa,EAAkC,EAAE;QACvD,IAAI,CAAC,CAAC,KAAK,YAAY,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtB,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ,CAAC;QACD,IAAI,aAAa,EAAE,CAAC;YAClB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,MAAM,MAAM,GACV,aAID,CAAC,IAAI,CAAC,CAAC;gBACR,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;oBACrB,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,OAAO,EAAE,MAAM,CAAC,OAAO;wBACvB,IAAI,EAAE,KAAK;qBACZ,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,KAAK;SACZ,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/set/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,cAAc,GAEf,MAAM,2BAA2B,CAAC;AASnC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAOlB,aAAkB,EAClB,OAAgB,EAEiB,EAAE;IACnC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAkC,EAAE;QACrE,IAAI,CAAC,CAAC,KAAK,YAAY,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtB,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ,CAAC;QACD,IAAI,aAAa,EAAE,CAAC;YAClB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,MAAM,MAAM,GACV,aAID,CAAC,IAAI,CAAC,CAAC;gBACR,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;oBACrB,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,OAAO,EAAE,MAAM,CAAC,OAAO;wBACvB,IAAI,EAAE,KAAK;qBACZ,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,KAAK;SACZ,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,cAAc,CAAsC,YAAY,CAAC,CAAC;AAC3E,CAAC,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Standard Schema V1 integration
3
+ *
4
+ * Defines the public Standard Schema V1 surface (https://standardschema.dev)
5
+ * and exposes the `attachStandard()` helper used by every UMT validator
6
+ * factory to advertise itself as a Standard Schema V1 implementation. The
7
+ * `~standard` property added by `attachStandard()` lets external tools
8
+ * (Zod-, Valibot-, ArkType-style ecosystems) consume UMT validators without
9
+ * adapters.
10
+ *
11
+ * Biome's `noNamespace` lint rule forbids TypeScript namespaces, so the spec
12
+ * is mirrored with flat interface/type names that remain structurally
13
+ * compatible with the official `StandardSchemaV1` interface published by
14
+ * `@standard-schema/spec`.
15
+ */
16
+ /** The Standard Schema V1 interface. */
17
+ export interface StandardSchemaV1<Input = unknown, Output = Input> {
18
+ readonly "~standard": StandardSchemaV1Properties<Input, Output>;
19
+ }
20
+ /** The Standard Schema V1 properties interface. */
21
+ export interface StandardSchemaV1Properties<Input = unknown, Output = Input> {
22
+ /** The version number of the standard. */
23
+ readonly version: 1;
24
+ /** The vendor name of the schema library. */
25
+ readonly vendor: string;
26
+ /** Validates unknown input values. */
27
+ readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
28
+ /** Inferred types associated with the schema. */
29
+ readonly types?: StandardSchemaV1Types<Input, Output> | undefined;
30
+ }
31
+ /** The result type produced by `Props.validate`. */
32
+ export type StandardSchemaV1Result<Output> = StandardSchemaV1SuccessResult<Output> | StandardSchemaV1FailureResult;
33
+ /** The result interface when validation succeeds. */
34
+ export interface StandardSchemaV1SuccessResult<Output> {
35
+ readonly value: Output;
36
+ readonly issues?: undefined;
37
+ }
38
+ /** The result interface when validation fails. */
39
+ export interface StandardSchemaV1FailureResult {
40
+ readonly issues: readonly StandardSchemaV1Issue[];
41
+ }
42
+ /** The issue interface returned on failure. */
43
+ export interface StandardSchemaV1Issue {
44
+ readonly message: string;
45
+ readonly path?: readonly (PropertyKey | StandardSchemaV1PathSegment)[] | undefined;
46
+ }
47
+ /** The path segment interface for nested issues. */
48
+ export interface StandardSchemaV1PathSegment {
49
+ readonly key: PropertyKey;
50
+ }
51
+ /** The Standard Schema V1 types interface. */
52
+ export interface StandardSchemaV1Types<Input = unknown, Output = Input> {
53
+ /** The input type of the schema. */
54
+ readonly input: Input;
55
+ /** The output type of the schema. */
56
+ readonly output: Output;
57
+ }
58
+ /** Infers the input type of a Standard Schema V1 implementation. */
59
+ export type StandardSchemaV1InferInput<Schema extends StandardSchemaV1<any, any>> = NonNullable<Schema["~standard"]["types"]>["input"];
60
+ /** Infers the output type of a Standard Schema V1 implementation. */
61
+ export type StandardSchemaV1InferOutput<Schema extends StandardSchemaV1<any, any>> = NonNullable<Schema["~standard"]["types"]>["output"];
62
+ /**
63
+ * Vendor identifier used by all UMT validators when advertising Standard
64
+ * Schema V1 compatibility. External tools may key off this value to attach
65
+ * UMT-specific behavior.
66
+ */
67
+ export declare const STANDARD_SCHEMA_VENDOR = "umt";
68
+ /** Minimal shape of UMT validator results consumed by `attachStandard`. */
69
+ export interface UmtValidatorResult {
70
+ validate: boolean;
71
+ message: string;
72
+ type: unknown;
73
+ }
74
+ /**
75
+ * Attaches a Standard Schema V1 `~standard` property to a UMT validator
76
+ * function in place. The validator's existing call signature, attached
77
+ * helpers (such as `shape` on `object()` or `implement` on `function_()`),
78
+ * and return type are preserved untouched; only the `~standard` property is
79
+ * added.
80
+ *
81
+ * Validation is delegated to the wrapped validator. On success the input
82
+ * value is returned through the Standard Schema `value` field; on failure a
83
+ * single issue carrying the validator's message is emitted. UMT validators
84
+ * never transform their input, so `Input` and `Output` default to the same
85
+ * type.
86
+ *
87
+ * @template Input - The input type advertised through `~standard.types`
88
+ * @template Output - The output type advertised through `~standard.types`
89
+ * @template F - The validator function being augmented
90
+ * @param {F} validator - The validator function to augment
91
+ * @returns {F & StandardSchemaV1<Input, Output>} The same function with `~standard` attached
92
+ */
93
+ export declare const attachStandard: <Input, Output = Input, F extends (...arguments_: any[]) => UmtValidatorResult = (...arguments_: any[]) => UmtValidatorResult>(validator: F) => F & StandardSchemaV1<Input, Output>;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Standard Schema V1 integration
3
+ *
4
+ * Defines the public Standard Schema V1 surface (https://standardschema.dev)
5
+ * and exposes the `attachStandard()` helper used by every UMT validator
6
+ * factory to advertise itself as a Standard Schema V1 implementation. The
7
+ * `~standard` property added by `attachStandard()` lets external tools
8
+ * (Zod-, Valibot-, ArkType-style ecosystems) consume UMT validators without
9
+ * adapters.
10
+ *
11
+ * Biome's `noNamespace` lint rule forbids TypeScript namespaces, so the spec
12
+ * is mirrored with flat interface/type names that remain structurally
13
+ * compatible with the official `StandardSchemaV1` interface published by
14
+ * `@standard-schema/spec`.
15
+ */
16
+ /**
17
+ * Vendor identifier used by all UMT validators when advertising Standard
18
+ * Schema V1 compatibility. External tools may key off this value to attach
19
+ * UMT-specific behavior.
20
+ */
21
+ export const STANDARD_SCHEMA_VENDOR = "umt";
22
+ /**
23
+ * Attaches a Standard Schema V1 `~standard` property to a UMT validator
24
+ * function in place. The validator's existing call signature, attached
25
+ * helpers (such as `shape` on `object()` or `implement` on `function_()`),
26
+ * and return type are preserved untouched; only the `~standard` property is
27
+ * added.
28
+ *
29
+ * Validation is delegated to the wrapped validator. On success the input
30
+ * value is returned through the Standard Schema `value` field; on failure a
31
+ * single issue carrying the validator's message is emitted. UMT validators
32
+ * never transform their input, so `Input` and `Output` default to the same
33
+ * type.
34
+ *
35
+ * @template Input - The input type advertised through `~standard.types`
36
+ * @template Output - The output type advertised through `~standard.types`
37
+ * @template F - The validator function being augmented
38
+ * @param {F} validator - The validator function to augment
39
+ * @returns {F & StandardSchemaV1<Input, Output>} The same function with `~standard` attached
40
+ */
41
+ export const attachStandard = (validator) => {
42
+ const properties = {
43
+ version: 1,
44
+ vendor: STANDARD_SCHEMA_VENDOR,
45
+ validate: (value) => {
46
+ const result = validator(value);
47
+ if (result.validate) {
48
+ return { value: value };
49
+ }
50
+ return {
51
+ issues: [{ message: result.message || "Validation failed" }],
52
+ };
53
+ },
54
+ };
55
+ validator["~standard"] = properties;
56
+ return validator;
57
+ };
58
+ //# sourceMappingURL=standardSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standardSchema.js","sourceRoot":"","sources":["../../src/Validate/standardSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAsEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC;AAS5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAS5B,SAAY,EACyB,EAAE;IACvC,MAAM,UAAU,GAA8C;QAC5D,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,sBAAsB;QAC9B,QAAQ,EAAE,CAAC,KAAc,EAAkC,EAAE;YAC3D,MAAM,MAAM,GACV,SACD,CAAC,KAAK,CAAC,CAAC;YACT,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACpB,OAAO,EAAE,KAAK,EAAE,KAAe,EAAE,CAAC;YACpC,CAAC;YACD,OAAO;gBACL,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,mBAAmB,EAAE,CAAC;aAC7D,CAAC;QACJ,CAAC;KACF,CAAC;IACD,SAAgD,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC;IAC5E,OAAO,SAAgD,CAAC;AAC1D,CAAC,CAAC"}
@@ -2,7 +2,8 @@
2
2
  * String validation core module
3
3
  * Provides the base validation functionality for string values
4
4
  */
5
- import type { ValidateReturnType } from "../../Validate/type";
5
+ import { type StandardSchemaV1 } from "../../Validate/standardSchema";
6
+ import type { ValidateCoreReturnType, ValidateReturnType } from "../../Validate/type";
6
7
  /**
7
8
  * Creates a string validator with optional validation rules
8
9
  * @template T - Array of validation rules for strings
@@ -10,4 +11,4 @@ import type { ValidateReturnType } from "../../Validate/type";
10
11
  * @param {string} [message] - Custom error message for type validation
11
12
  * @returns {Function} - Validator function that checks if the value is a string and applies validation rules
12
13
  */
13
- export declare const string: <T extends ValidateReturnType<string>[]>(option?: T, message?: string) => (value: string) => import("../../Validate/type").ValidateCoreReturnType<string>;
14
+ export declare const string: <T extends ValidateReturnType<string>[]>(option?: T, message?: string) => ((value: string) => ValidateCoreReturnType<string>) & StandardSchemaV1<string, string>;
@@ -3,6 +3,7 @@
3
3
  * Provides the base validation functionality for string values
4
4
  */
5
5
  import { core } from "../../Validate/core";
6
+ import { attachStandard, } from "../../Validate/standardSchema";
6
7
  /**
7
8
  * Creates a string validator with optional validation rules
8
9
  * @template T - Array of validation rules for strings
@@ -10,5 +11,8 @@ import { core } from "../../Validate/core";
10
11
  * @param {string} [message] - Custom error message for type validation
11
12
  * @returns {Function} - Validator function that checks if the value is a string and applies validation rules
12
13
  */
13
- export const string = (option, message) => (value) => core("string")(value, option, message);
14
+ export const string = (option, message) => {
15
+ const validator = (value) => core("string")(value, option, message);
16
+ return attachStandard(validator);
17
+ };
14
18
  //# sourceMappingURL=core.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/string/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGvC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GACjB,CAAyC,MAAU,EAAE,OAAgB,EAAE,EAAE,CACzE,CAAC,KAAa,EAAE,EAAE,CAChB,IAAI,CAAS,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/string/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EACL,cAAc,GAEf,MAAM,2BAA2B,CAAC;AAMnC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,MAAU,EACV,OAAgB,EAEiB,EAAE;IACnC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAClC,IAAI,CAAS,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,OAAO,cAAc,CAAmC,SAAS,CAAC,CAAC;AACrE,CAAC,CAAC"}
@@ -6,6 +6,7 @@
6
6
  * an auto-generated regular expression assembled from the parts, while the
7
7
  * inferred type is the corresponding TypeScript template literal type.
8
8
  */
9
+ import { type StandardSchemaV1 } from "../../Validate/standardSchema";
9
10
  import type { ValidateType } from "../../Validate/type";
10
11
  export type TemplateLiteralAnyValidator = (value?: any) => {
11
12
  type: unknown;
@@ -51,4 +52,4 @@ export interface TemplateLiteralReturnType<T extends string> {
51
52
  * @param {string} [message] - Custom error message for validation failure
52
53
  * @returns {Function} - Validator function for template literal strings
53
54
  */
54
- export declare const templateLiteral: <const Parts extends readonly TemplateLiteralPart[]>(parts: Parts, message?: string) => (value: BuildTemplateLiteral<Parts>) => TemplateLiteralReturnType<BuildTemplateLiteral<Parts>>;
55
+ export declare const templateLiteral: <const Parts extends readonly TemplateLiteralPart[]>(parts: Parts, message?: string) => ((value: BuildTemplateLiteral<Parts>) => TemplateLiteralReturnType<BuildTemplateLiteral<Parts>>) & StandardSchemaV1<BuildTemplateLiteral<Parts>, BuildTemplateLiteral<Parts>>;
@@ -6,6 +6,7 @@
6
6
  * an auto-generated regular expression assembled from the parts, while the
7
7
  * inferred type is the corresponding TypeScript template literal type.
8
8
  */
9
+ import { attachStandard, } from "../../Validate/standardSchema";
9
10
  const escapeRegex = (input) => input.replaceAll(/[$()*+.?[\\\]^{|}]/g, String.raw `\$&`);
10
11
  const tagToPattern = (tag) => {
11
12
  switch (tag) {
@@ -50,7 +51,7 @@ export const templateLiteral = (parts, message) => {
50
51
  }
51
52
  pattern += "$";
52
53
  const regex = new RegExp(pattern);
53
- return (value) => {
54
+ const templateValidator = (value) => {
54
55
  if (typeof value !== "string" || !regex.test(value)) {
55
56
  return {
56
57
  validate: false,
@@ -64,5 +65,6 @@ export const templateLiteral = (parts, message) => {
64
65
  type: value,
65
66
  };
66
67
  };
68
+ return attachStandard(templateValidator);
67
69
  };
68
70
  //# sourceMappingURL=core.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/templateLiteral/core.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2DH,MAAM,WAAW,GAAG,CAAC,KAAa,EAAU,EAAE,CAC5C,KAAK,CAAC,UAAU,CAAC,qBAAqB,EAAE,MAAM,CAAC,GAAG,CAAA,KAAK,CAAC,CAAC;AAE3D,MAAM,YAAY,GAAG,CAAC,GAAY,EAAU,EAAE;IAC5C,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,OAAO,KAAK,CAAC;QACf,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,OAAO,MAAM,CAAC,GAAG,CAAA,oCAAoC,CAAC;QACxD,CAAC;QACD,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,OAAO,gBAAgB,CAAC;QAC1B,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,OAAO,MAAM,CAAC,GAAG,CAAA,OAAO,CAAC;QAC3B,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,SAAsC,EAC7B,EAAE;IACX,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,OAAO,MAAM,EAAE,IAAI,CAAC;AACtB,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAG7B,KAAY,EACZ,OAAgB,EAChB,EAAE;IACF,IAAI,OAAO,GAAG,GAAG,CAAC;IAClB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO;YACL,OAAO,IAAI,KAAK,QAAQ;gBACtB,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC;gBACnB,CAAC,CAAC,MAAM,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;IACxD,CAAC;IACD,OAAO,IAAI,GAAG,CAAC;IACf,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAElC,OAAO,CACL,KAAkC,EACsB,EAAE;QAC1D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACpD,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtB,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,KAAK;SACZ,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/templateLiteral/core.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,cAAc,GAEf,MAAM,2BAA2B,CAAC;AA0DnC,MAAM,WAAW,GAAG,CAAC,KAAa,EAAU,EAAE,CAC5C,KAAK,CAAC,UAAU,CAAC,qBAAqB,EAAE,MAAM,CAAC,GAAG,CAAA,KAAK,CAAC,CAAC;AAE3D,MAAM,YAAY,GAAG,CAAC,GAAY,EAAU,EAAE;IAC5C,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,OAAO,KAAK,CAAC;QACf,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,OAAO,MAAM,CAAC,GAAG,CAAA,oCAAoC,CAAC;QACxD,CAAC;QACD,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,OAAO,gBAAgB,CAAC;QAC1B,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,OAAO,MAAM,CAAC,GAAG,CAAA,OAAO,CAAC;QAC3B,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,SAAsC,EAC7B,EAAE;IACX,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,OAAO,MAAM,EAAE,IAAI,CAAC;AACtB,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAG7B,KAAY,EACZ,OAAgB,EAOd,EAAE;IACJ,IAAI,OAAO,GAAG,GAAG,CAAC;IAClB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO;YACL,OAAO,IAAI,KAAK,QAAQ;gBACtB,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC;gBACnB,CAAC,CAAC,MAAM,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;IACxD,CAAC;IACD,OAAO,IAAI,GAAG,CAAC;IACf,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAElC,MAAM,iBAAiB,GAAG,CACxB,KAAkC,EACsB,EAAE;QAC1D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACpD,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtB,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,KAAK;SACZ,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,cAAc,CAInB,iBAAiB,CAAC,CAAC;AACvB,CAAC,CAAC"}
@@ -3,6 +3,7 @@
3
3
  * Provides a validator that accepts any value but exposes it as `unknown`
4
4
  * to keep callers honest about narrowing before use.
5
5
  */
6
+ import { type StandardSchemaV1 } from "../../Validate/standardSchema";
6
7
  /**
7
8
  * Return type produced by an `unknown` validator. Exposes the literal
8
9
  * `"unknown"` tag through the `type` field so `ValidateType<"unknown">` can
@@ -18,4 +19,4 @@ export interface UnknownReturnType {
18
19
  * Creates a validator that accepts any value but typed as unknown
19
20
  * @returns {Function} - Validator that always succeeds
20
21
  */
21
- export declare const unknown: () => ((value: unknown) => UnknownReturnType);
22
+ export declare const unknown: () => ((value: unknown) => UnknownReturnType) & StandardSchemaV1<unknown, unknown>;
@@ -3,14 +3,16 @@
3
3
  * Provides a validator that accepts any value but exposes it as `unknown`
4
4
  * to keep callers honest about narrowing before use.
5
5
  */
6
+ import { attachStandard, } from "../../Validate/standardSchema";
6
7
  const unknownValidator = (_value) => ({
7
8
  validate: true,
8
9
  message: "",
9
10
  type: "unknown",
10
11
  });
12
+ const standardUnknownValidator = attachStandard(unknownValidator);
11
13
  /**
12
14
  * Creates a validator that accepts any value but typed as unknown
13
15
  * @returns {Function} - Validator that always succeeds
14
16
  */
15
- export const unknown = () => unknownValidator;
17
+ export const unknown = () => standardUnknownValidator;
16
18
  //# sourceMappingURL=core.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/unknown/core.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,MAAM,gBAAgB,GAAG,CAAC,MAAe,EAAqB,EAAE,CAAC,CAAC;IAChE,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,SAAS;CAChB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,GAA4C,EAAE,CACnE,gBAAgB,CAAC"}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/unknown/core.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,GAEf,MAAM,2BAA2B,CAAC;AAcnC,MAAM,gBAAgB,GAAG,CAAC,MAAe,EAAqB,EAAE,CAAC,CAAC;IAChE,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,SAAS;CAChB,CAAC,CAAC;AAEH,MAAM,wBAAwB,GAAG,cAAc,CAI7C,gBAAgB,CAAC,CAAC;AAEpB;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,GACc,EAAE,CAAC,wBAAwB,CAAC"}
@@ -4,6 +4,7 @@
4
4
  * schema needs to remain wide open while still participating in `object()`,
5
5
  * `union()`, `intersection()`, and other compositional helpers.
6
6
  */
7
+ import { type StandardSchemaV1 } from "../../Validate/standardSchema";
7
8
  /**
8
9
  * Return type produced by an `any` validator. Exposes the literal `"any"`
9
10
  * tag through the `type` field so `ValidateType<"any">` can map it back to
@@ -18,4 +19,4 @@ export interface AnyReturnType {
18
19
  * Creates a validator that accepts any value
19
20
  * @returns {Function} - Validator that always succeeds
20
21
  */
21
- export declare const any: () => ((value: any) => AnyReturnType);
22
+ export declare const any: () => ((value: any) => AnyReturnType) & StandardSchemaV1<any, any>;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.any = void 0;
7
+ var _standardSchema = require("../../Validate/standardSchema");
7
8
  /**
8
9
  * Any validation core module
9
10
  * Provides a validator that accepts any value, useful when a position in a
@@ -25,12 +26,12 @@ var anyValidator = function anyValidator(_value) {
25
26
  type: "any"
26
27
  };
27
28
  };
29
+ var standardAnyValidator = (0, _standardSchema.attachStandard)(anyValidator);
28
30
 
29
31
  /**
30
32
  * Creates a validator that accepts any value
31
33
  * @returns {Function} - Validator that always succeeds
32
34
  */
33
- // biome-ignore lint/suspicious/noExplicitAny: any() must accept and infer any value
34
35
  var any = exports.any = function any() {
35
- return anyValidator;
36
+ return standardAnyValidator;
36
37
  };
@@ -1,3 +1,4 @@
1
+ import { type StandardSchemaV1 } from "../../Validate/standardSchema";
1
2
  import type { ValidateCoreReturnType, ValidateType } from "../../Validate/type";
2
3
  export type ArrayOfExtractValidatedType<V> = V extends (value: never) => {
3
4
  type: infer T;
@@ -13,4 +14,4 @@ export declare const arrayOf: <V extends (value: never) => {
13
14
  type: unknown;
14
15
  message: string;
15
16
  validate: boolean;
16
- }>(validator: V, message?: string) => (values: ArrayOfExtractValidatedType<V>[]) => ValidateCoreReturnType<ArrayOfExtractValidatedType<V>[]>;
17
+ }>(validator: V, message?: string) => ((values: ArrayOfExtractValidatedType<V>[]) => ValidateCoreReturnType<ArrayOfExtractValidatedType<V>[]>) & StandardSchemaV1<ArrayOfExtractValidatedType<V>[], ArrayOfExtractValidatedType<V>[]>;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.arrayOf = void 0;
7
7
  var _isArray = require("../../Validate/isArray");
8
+ var _standardSchema = require("../../Validate/standardSchema");
8
9
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
9
10
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
11
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
@@ -22,7 +23,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
22
23
  * @returns {Function} - Validator function for arrays whose elements satisfy the given validator
23
24
  */
24
25
  var arrayOf = exports.arrayOf = function arrayOf(validator, message) {
25
- return function (values) {
26
+ var arrayValidator = function arrayValidator(values) {
26
27
  if (!(0, _isArray.isArray)(values)) {
27
28
  return {
28
29
  validate: false,
@@ -55,4 +56,5 @@ var arrayOf = exports.arrayOf = function arrayOf(validator, message) {
55
56
  type: values
56
57
  };
57
58
  };
59
+ return (0, _standardSchema.attachStandard)(arrayValidator);
58
60
  };
@@ -2,6 +2,7 @@
2
2
  * BigInt validation core module
3
3
  * Provides the base validation functionality for bigint values
4
4
  */
5
+ import { type StandardSchemaV1 } from "../../Validate/standardSchema";
5
6
  import type { ValidateReturnType } from "../../Validate/type";
6
7
  /**
7
8
  * Return type produced by a `bigint` validator. Structurally compatible with
@@ -21,4 +22,4 @@ export interface BigIntReturnType {
21
22
  * @param {string} [message] - Custom error message for type validation
22
23
  * @returns {Function} - Validator function that checks if the value is a bigint and applies validation rules
23
24
  */
24
- export declare const bigint: <T extends ValidateReturnType<bigint>[]>(option?: T, message?: string) => (value: bigint) => BigIntReturnType;
25
+ export declare const bigint: <T extends ValidateReturnType<bigint>[]>(option?: T, message?: string) => ((value: bigint) => BigIntReturnType) & StandardSchemaV1<bigint, bigint>;
@@ -4,14 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.bigint = void 0;
7
+ var _standardSchema = require("../../Validate/standardSchema");
7
8
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
8
9
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
9
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
10
- /**
10
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /**
11
11
  * BigInt validation core module
12
12
  * Provides the base validation functionality for bigint values
13
13
  */
14
-
15
14
  /**
16
15
  * Return type produced by a `bigint` validator. Structurally compatible with
17
16
  * `ValidateCoreReturnType<bigint>`, but exposes the literal `"bigint"` tag
@@ -29,7 +28,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
29
28
  var bigint = exports.bigint = function bigint() {
30
29
  var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
31
30
  var message = arguments.length > 1 ? arguments[1] : undefined;
32
- return function (value) {
31
+ var validator = function validator(value) {
33
32
  if (typeof value !== "bigint") {
34
33
  return {
35
34
  validate: false,
@@ -62,4 +61,5 @@ var bigint = exports.bigint = function bigint() {
62
61
  type: "bigint"
63
62
  };
64
63
  };
64
+ return (0, _standardSchema.attachStandard)(validator);
65
65
  };
@@ -2,10 +2,11 @@
2
2
  * Boolean validation core module
3
3
  * Provides the base validation functionality for boolean values
4
4
  */
5
+ import { type StandardSchemaV1 } from "../../Validate/standardSchema";
5
6
  import type { ValidateCoreReturnType } from "../../Validate/type";
6
7
  /**
7
8
  * Creates a boolean validator
8
9
  * @param {string} [message] - Custom error message for type validation
9
10
  * @returns {Function} - Validator function that checks if the value is a boolean
10
11
  */
11
- export declare const boolean: (message?: string) => (value: boolean) => ValidateCoreReturnType<boolean>;
12
+ export declare const boolean: (message?: string) => ((value: boolean) => ValidateCoreReturnType<boolean>) & StandardSchemaV1<boolean, boolean>;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["boolean"] = void 0;
7
7
  var _core = require("../../Validate/core");
8
+ var _standardSchema = require("../../Validate/standardSchema");
8
9
  /**
9
10
  * Boolean validation core module
10
11
  * Provides the base validation functionality for boolean values
@@ -16,7 +17,8 @@ var _core = require("../../Validate/core");
16
17
  * @returns {Function} - Validator function that checks if the value is a boolean
17
18
  */
18
19
  var _boolean = exports["boolean"] = function _boolean(message) {
19
- return function (value) {
20
+ var validator = function validator(value) {
20
21
  return (0, _core.core)("boolean")(value, [], message);
21
22
  };
23
+ return (0, _standardSchema.attachStandard)(validator);
22
24
  };
@@ -2,6 +2,7 @@
2
2
  * Date validation core module
3
3
  * Provides the base validation functionality for Date instances
4
4
  */
5
+ import { type StandardSchemaV1 } from "../../Validate/standardSchema";
5
6
  import type { ValidateCoreReturnType } from "../../Validate/type";
6
7
  /**
7
8
  * Creates a Date validator. The validator checks both that the value is an
@@ -11,4 +12,4 @@ import type { ValidateCoreReturnType } from "../../Validate/type";
11
12
  * @param {string} [message] - Custom error message for type validation
12
13
  * @returns {Function} - Validator function that checks if the value is a Date instance
13
14
  */
14
- export declare const date: (message?: string) => (value: Date) => ValidateCoreReturnType<Date>;
15
+ export declare const date: (message?: string) => ((value: Date) => ValidateCoreReturnType<Date>) & StandardSchemaV1<Date, Date>;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.date = void 0;
7
+ var _standardSchema = require("../../Validate/standardSchema");
7
8
  /**
8
9
  * Date validation core module
9
10
  * Provides the base validation functionality for Date instances
@@ -18,7 +19,7 @@ exports.date = void 0;
18
19
  * @returns {Function} - Validator function that checks if the value is a Date instance
19
20
  */
20
21
  var date = exports.date = function date(message) {
21
- return function (value) {
22
+ var validator = function validator(value) {
22
23
  if (!(value instanceof Date) || Number.isNaN(value.getTime())) {
23
24
  return {
24
25
  validate: false,
@@ -32,4 +33,5 @@ var date = exports.date = function date(message) {
32
33
  type: value
33
34
  };
34
35
  };
36
+ return (0, _standardSchema.attachStandard)(validator);
35
37
  };