compat.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. // Zod 3 compat layer
  2. import * as core from "../core/index.js";
  3. /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
  4. export const ZodIssueCode = {
  5. invalid_type: "invalid_type",
  6. too_big: "too_big",
  7. too_small: "too_small",
  8. invalid_format: "invalid_format",
  9. not_multiple_of: "not_multiple_of",
  10. unrecognized_keys: "unrecognized_keys",
  11. invalid_union: "invalid_union",
  12. invalid_key: "invalid_key",
  13. invalid_element: "invalid_element",
  14. invalid_value: "invalid_value",
  15. custom: "custom",
  16. };
  17. export { $brand, config } from "../core/index.js";
  18. /** @deprecated Use `z.config(params)` instead. */
  19. export function setErrorMap(map) {
  20. core.config({
  21. customError: map,
  22. });
  23. }
  24. /** @deprecated Use `z.config()` instead. */
  25. export function getErrorMap() {
  26. return core.config().customError;
  27. }
  28. /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
  29. export var ZodFirstPartyTypeKind;
  30. (function (ZodFirstPartyTypeKind) {
  31. })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));