zod 4.1.0-canary.20250729T005826 → 4.1.0-canary.20250729T053738

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 (124) hide show
  1. package/package.json +6 -4
  2. package/src/v4/classic/checks.ts +1 -0
  3. package/src/v4/classic/schemas.ts +12 -28
  4. package/src/v4/classic/tests/datetime.test.ts +6 -0
  5. package/src/v4/classic/tests/number.test.ts +23 -0
  6. package/src/v4/classic/tests/recursive-types.test.ts +39 -0
  7. package/src/v4/classic/tests/string.test.ts +38 -0
  8. package/src/v4/classic/tests/tuple.test.ts +2 -2
  9. package/src/v4/core/api.ts +51 -7
  10. package/src/v4/core/checks.ts +2 -0
  11. package/src/v4/core/errors.ts +26 -23
  12. package/src/v4/core/regexes.ts +7 -4
  13. package/src/v4/core/schemas.ts +41 -4
  14. package/src/v4/core/util.ts +11 -1
  15. package/src/v4/core/versions.ts +1 -1
  16. package/src/v4/mini/schemas.ts +11 -0
  17. package/v3/locales/en.cjs +1 -0
  18. package/v3/locales/en.d.cts +1 -1
  19. package/v4/classic/checks.d.cts +1 -1
  20. package/v4/classic/checks.d.ts +1 -1
  21. package/v4/classic/schemas.cjs +5 -20
  22. package/v4/classic/schemas.d.cts +5 -7
  23. package/v4/classic/schemas.d.ts +5 -7
  24. package/v4/classic/schemas.js +4 -20
  25. package/v4/core/api.cjs +33 -7
  26. package/v4/core/api.d.cts +12 -0
  27. package/v4/core/api.d.ts +12 -0
  28. package/v4/core/api.js +31 -7
  29. package/v4/core/checks.cjs +2 -0
  30. package/v4/core/checks.js +2 -0
  31. package/v4/core/errors.d.cts +17 -16
  32. package/v4/core/errors.d.ts +17 -16
  33. package/v4/core/regexes.cjs +6 -5
  34. package/v4/core/regexes.d.cts +1 -0
  35. package/v4/core/regexes.d.ts +1 -0
  36. package/v4/core/regexes.js +5 -4
  37. package/v4/core/schemas.cjs +8 -3
  38. package/v4/core/schemas.d.cts +3 -1
  39. package/v4/core/schemas.d.ts +3 -1
  40. package/v4/core/schemas.js +8 -3
  41. package/v4/core/util.cjs +9 -1
  42. package/v4/core/util.js +9 -1
  43. package/v4/core/versions.cjs +1 -1
  44. package/v4/core/versions.js +1 -1
  45. package/v4/locales/ar.cjs +1 -0
  46. package/v4/locales/ar.d.cts +2 -1
  47. package/v4/locales/az.cjs +1 -0
  48. package/v4/locales/az.d.cts +2 -1
  49. package/v4/locales/be.cjs +1 -0
  50. package/v4/locales/be.d.cts +2 -1
  51. package/v4/locales/ca.cjs +1 -0
  52. package/v4/locales/ca.d.cts +2 -1
  53. package/v4/locales/cs.cjs +1 -0
  54. package/v4/locales/cs.d.cts +2 -1
  55. package/v4/locales/da.cjs +1 -0
  56. package/v4/locales/da.d.cts +2 -1
  57. package/v4/locales/de.cjs +1 -0
  58. package/v4/locales/de.d.cts +2 -1
  59. package/v4/locales/es.cjs +1 -0
  60. package/v4/locales/es.d.cts +2 -1
  61. package/v4/locales/fa.cjs +1 -0
  62. package/v4/locales/fa.d.cts +2 -1
  63. package/v4/locales/fi.cjs +1 -0
  64. package/v4/locales/fi.d.cts +2 -1
  65. package/v4/locales/fr-CA.cjs +1 -0
  66. package/v4/locales/fr-CA.d.cts +2 -1
  67. package/v4/locales/fr.cjs +1 -0
  68. package/v4/locales/fr.d.cts +2 -1
  69. package/v4/locales/he.cjs +1 -0
  70. package/v4/locales/he.d.cts +2 -1
  71. package/v4/locales/hu.cjs +1 -0
  72. package/v4/locales/hu.d.cts +2 -1
  73. package/v4/locales/id.cjs +1 -0
  74. package/v4/locales/id.d.cts +2 -1
  75. package/v4/locales/it.cjs +1 -0
  76. package/v4/locales/it.d.cts +2 -1
  77. package/v4/locales/ja.cjs +1 -0
  78. package/v4/locales/ja.d.cts +2 -1
  79. package/v4/locales/kh.cjs +1 -0
  80. package/v4/locales/kh.d.cts +2 -1
  81. package/v4/locales/ko.cjs +1 -0
  82. package/v4/locales/ko.d.cts +2 -1
  83. package/v4/locales/mk.cjs +1 -0
  84. package/v4/locales/mk.d.cts +2 -1
  85. package/v4/locales/ms.cjs +1 -0
  86. package/v4/locales/ms.d.cts +2 -1
  87. package/v4/locales/nl.cjs +1 -0
  88. package/v4/locales/nl.d.cts +2 -1
  89. package/v4/locales/no.cjs +1 -0
  90. package/v4/locales/no.d.cts +2 -1
  91. package/v4/locales/ota.cjs +1 -0
  92. package/v4/locales/ota.d.cts +2 -1
  93. package/v4/locales/pl.cjs +1 -0
  94. package/v4/locales/pl.d.cts +2 -1
  95. package/v4/locales/ps.cjs +1 -0
  96. package/v4/locales/ps.d.cts +2 -1
  97. package/v4/locales/pt.cjs +1 -0
  98. package/v4/locales/pt.d.cts +2 -1
  99. package/v4/locales/ru.cjs +1 -0
  100. package/v4/locales/ru.d.cts +2 -1
  101. package/v4/locales/sl.cjs +1 -0
  102. package/v4/locales/sl.d.cts +2 -1
  103. package/v4/locales/sv.cjs +1 -0
  104. package/v4/locales/sv.d.cts +2 -1
  105. package/v4/locales/ta.cjs +1 -0
  106. package/v4/locales/ta.d.cts +2 -1
  107. package/v4/locales/th.cjs +1 -0
  108. package/v4/locales/th.d.cts +2 -1
  109. package/v4/locales/ua.cjs +1 -0
  110. package/v4/locales/ua.d.cts +2 -1
  111. package/v4/locales/ur.cjs +1 -0
  112. package/v4/locales/ur.d.cts +2 -1
  113. package/v4/locales/vi.cjs +1 -0
  114. package/v4/locales/vi.d.cts +2 -1
  115. package/v4/locales/yo.cjs +1 -0
  116. package/v4/locales/yo.d.cts +2 -1
  117. package/v4/locales/zh-CN.cjs +1 -0
  118. package/v4/locales/zh-CN.d.cts +2 -1
  119. package/v4/locales/zh-TW.cjs +1 -0
  120. package/v4/locales/zh-TW.d.cts +2 -1
  121. package/v4/mini/schemas.cjs +9 -0
  122. package/v4/mini/schemas.d.cts +2 -0
  123. package/v4/mini/schemas.d.ts +2 -0
  124. package/v4/mini/schemas.js +7 -0
package/v4/locales/da.cjs CHANGED
@@ -155,3 +155,4 @@ function default_1() {
155
155
  localeError: error(),
156
156
  };
157
157
  }
158
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/de.cjs CHANGED
@@ -140,3 +140,4 @@ function default_1() {
140
140
  localeError: error(),
141
141
  };
142
142
  }
143
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/es.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/fa.cjs CHANGED
@@ -146,3 +146,4 @@ function default_1() {
146
146
  localeError: error(),
147
147
  };
148
148
  }
149
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/fi.cjs CHANGED
@@ -146,3 +146,4 @@ function default_1() {
146
146
  localeError: error(),
147
147
  };
148
148
  }
149
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/fr.cjs CHANGED
@@ -140,3 +140,4 @@ function default_1() {
140
140
  localeError: error(),
141
141
  };
142
142
  }
143
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/he.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/hu.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/id.cjs CHANGED
@@ -140,3 +140,4 @@ function default_1() {
140
140
  localeError: error(),
141
141
  };
142
142
  }
143
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/it.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/ja.cjs CHANGED
@@ -139,3 +139,4 @@ function default_1() {
139
139
  localeError: error(),
140
140
  };
141
141
  }
142
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/kh.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/ko.cjs CHANGED
@@ -145,3 +145,4 @@ function default_1() {
145
145
  localeError: error(),
146
146
  };
147
147
  }
148
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/mk.cjs CHANGED
@@ -142,3 +142,4 @@ function default_1() {
142
142
  localeError: error(),
143
143
  };
144
144
  }
145
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/ms.cjs CHANGED
@@ -140,3 +140,4 @@ function default_1() {
140
140
  localeError: error(),
141
141
  };
142
142
  }
143
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/nl.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/no.cjs CHANGED
@@ -140,3 +140,4 @@ function default_1() {
140
140
  localeError: error(),
141
141
  };
142
142
  }
143
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/pl.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/ps.cjs CHANGED
@@ -146,3 +146,4 @@ function default_1() {
146
146
  localeError: error(),
147
147
  };
148
148
  }
149
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/pt.cjs CHANGED
@@ -140,3 +140,4 @@ function default_1() {
140
140
  localeError: error(),
141
141
  };
142
142
  }
143
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/ru.cjs CHANGED
@@ -188,3 +188,4 @@ function default_1() {
188
188
  localeError: error(),
189
189
  };
190
190
  }
191
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/sl.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/sv.cjs CHANGED
@@ -142,3 +142,4 @@ function default_1() {
142
142
  localeError: error(),
143
143
  };
144
144
  }
145
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/ta.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/th.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/ua.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/ur.cjs CHANGED
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/vi.cjs CHANGED
@@ -140,3 +140,4 @@ function default_1() {
140
140
  localeError: error(),
141
141
  };
142
142
  }
143
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
package/v4/locales/yo.cjs CHANGED
@@ -139,3 +139,4 @@ function default_1() {
139
139
  localeError: error(),
140
140
  };
141
141
  }
142
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
@@ -140,3 +140,4 @@ function default_1() {
140
140
  localeError: error(),
141
141
  };
142
142
  }
143
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
@@ -141,3 +141,4 @@ function default_1() {
141
141
  localeError: error(),
142
142
  };
143
143
  }
144
+ module.exports = exports.default;
@@ -1,4 +1,5 @@
1
1
  import type * as errors from "../core/errors.cjs";
2
- export default function (): {
2
+ declare function _default(): {
3
3
  localeError: errors.$ZodErrorMap;
4
4
  };
5
+ export = _default;
@@ -49,6 +49,7 @@ exports.base64url = base64url;
49
49
  exports.e164 = e164;
50
50
  exports.jwt = jwt;
51
51
  exports.stringFormat = stringFormat;
52
+ exports.hostname = hostname;
52
53
  exports.number = number;
53
54
  exports.int = int;
54
55
  exports.float32 = float32;
@@ -109,6 +110,7 @@ exports.promise = promise;
109
110
  exports.check = check;
110
111
  exports.custom = custom;
111
112
  exports.refine = refine;
113
+ exports.superRefine = superRefine;
112
114
  exports.instanceof = _instanceof;
113
115
  exports.json = json;
114
116
  const core = __importStar(require("../core/index.cjs"));
@@ -303,6 +305,9 @@ exports.ZodMiniCustomStringFormat = core.$constructor("ZodMiniCustomStringFormat
303
305
  function stringFormat(format, fnOrRegex, _params = {}) {
304
306
  return core._stringFormat(exports.ZodMiniCustomStringFormat, format, fnOrRegex, _params);
305
307
  }
308
+ function hostname(_params) {
309
+ return core._stringFormat(exports.ZodMiniCustomStringFormat, "hostname", core.regexes.hostname, _params);
310
+ }
306
311
  exports.ZodMiniNumber = core.$constructor("ZodMiniNumber", (inst, def) => {
307
312
  core.$ZodNumber.init(inst, def);
308
313
  exports.ZodMiniType.init(inst, def);
@@ -814,6 +819,10 @@ function custom(fn, _params) {
814
819
  function refine(fn, _params = {}) {
815
820
  return core._refine(exports.ZodMiniCustom, fn, _params);
816
821
  }
822
+ // superRefine
823
+ function superRefine(fn) {
824
+ return core._superRefine(fn);
825
+ }
817
826
  // instanceof
818
827
  class Class {
819
828
  constructor(..._args) { }
@@ -111,6 +111,7 @@ export interface ZodMiniCustomStringFormat<Format extends string = string> exten
111
111
  }
112
112
  export declare const ZodMiniCustomStringFormat: core.$constructor<ZodMiniCustomStringFormat>;
113
113
  export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<Format>;
114
+ export declare function hostname(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hostname">;
114
115
  interface _ZodMiniNumber<T extends core.$ZodNumberInternals<unknown> = core.$ZodNumberInternals<unknown>> extends _ZodMiniType<T>, core.$ZodNumber<T["input"]> {
115
116
  _zod: T;
116
117
  }
@@ -331,6 +332,7 @@ export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
331
332
  export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
332
333
  export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
333
334
  export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
335
+ export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T>;
334
336
  declare abstract class Class {
335
337
  constructor(..._args: any[]);
336
338
  }
@@ -111,6 +111,7 @@ export interface ZodMiniCustomStringFormat<Format extends string = string> exten
111
111
  }
112
112
  export declare const ZodMiniCustomStringFormat: core.$constructor<ZodMiniCustomStringFormat>;
113
113
  export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<Format>;
114
+ export declare function hostname(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hostname">;
114
115
  interface _ZodMiniNumber<T extends core.$ZodNumberInternals<unknown> = core.$ZodNumberInternals<unknown>> extends _ZodMiniType<T>, core.$ZodNumber<T["input"]> {
115
116
  _zod: T;
116
117
  }
@@ -331,6 +332,7 @@ export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
331
332
  export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
332
333
  export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
333
334
  export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
335
+ export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T>;
334
336
  declare abstract class Class {
335
337
  constructor(..._args: any[]);
336
338
  }
@@ -190,6 +190,9 @@ export const ZodMiniCustomStringFormat = /*@__PURE__*/ core.$constructor("ZodMin
190
190
  export function stringFormat(format, fnOrRegex, _params = {}) {
191
191
  return core._stringFormat(ZodMiniCustomStringFormat, format, fnOrRegex, _params);
192
192
  }
193
+ export function hostname(_params) {
194
+ return core._stringFormat(ZodMiniCustomStringFormat, "hostname", core.regexes.hostname, _params);
195
+ }
193
196
  export const ZodMiniNumber = /*@__PURE__*/ core.$constructor("ZodMiniNumber", (inst, def) => {
194
197
  core.$ZodNumber.init(inst, def);
195
198
  ZodMiniType.init(inst, def);
@@ -707,6 +710,10 @@ export function custom(fn, _params) {
707
710
  export function refine(fn, _params = {}) {
708
711
  return core._refine(ZodMiniCustom, fn, _params);
709
712
  }
713
+ // superRefine
714
+ export function superRefine(fn) {
715
+ return core._superRefine(fn);
716
+ }
710
717
  // instanceof
711
718
  class Class {
712
719
  constructor(..._args) { }