compat.cjs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. "use strict";
  2. // Zod 3 compat layer
  3. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4. if (k2 === undefined) k2 = k;
  5. var desc = Object.getOwnPropertyDescriptor(m, k);
  6. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  7. desc = { enumerable: true, get: function() { return m[k]; } };
  8. }
  9. Object.defineProperty(o, k2, desc);
  10. }) : (function(o, m, k, k2) {
  11. if (k2 === undefined) k2 = k;
  12. o[k2] = m[k];
  13. }));
  14. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  15. Object.defineProperty(o, "default", { enumerable: true, value: v });
  16. }) : function(o, v) {
  17. o["default"] = v;
  18. });
  19. var __importStar = (this && this.__importStar) || function (mod) {
  20. if (mod && mod.__esModule) return mod;
  21. var result = {};
  22. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  23. __setModuleDefault(result, mod);
  24. return result;
  25. };
  26. Object.defineProperty(exports, "__esModule", { value: true });
  27. exports.ZodFirstPartyTypeKind = exports.config = exports.$brand = exports.ZodIssueCode = void 0;
  28. exports.setErrorMap = setErrorMap;
  29. exports.getErrorMap = getErrorMap;
  30. const core = __importStar(require("../core/index.cjs"));
  31. /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
  32. exports.ZodIssueCode = {
  33. invalid_type: "invalid_type",
  34. too_big: "too_big",
  35. too_small: "too_small",
  36. invalid_format: "invalid_format",
  37. not_multiple_of: "not_multiple_of",
  38. unrecognized_keys: "unrecognized_keys",
  39. invalid_union: "invalid_union",
  40. invalid_key: "invalid_key",
  41. invalid_element: "invalid_element",
  42. invalid_value: "invalid_value",
  43. custom: "custom",
  44. };
  45. var index_js_1 = require("../core/index.cjs");
  46. Object.defineProperty(exports, "$brand", { enumerable: true, get: function () { return index_js_1.$brand; } });
  47. Object.defineProperty(exports, "config", { enumerable: true, get: function () { return index_js_1.config; } });
  48. /** @deprecated Use `z.config(params)` instead. */
  49. function setErrorMap(map) {
  50. core.config({
  51. customError: map,
  52. });
  53. }
  54. /** @deprecated Use `z.config()` instead. */
  55. function getErrorMap() {
  56. return core.config().customError;
  57. }
  58. /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
  59. var ZodFirstPartyTypeKind;
  60. (function (ZodFirstPartyTypeKind) {
  61. })(ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = ZodFirstPartyTypeKind = {}));