{"version":3,"sources":["../../source/custom/runtime/runtime.ts","../../source/custom/validation/validation.ts"],"names":["ModernError","z","RuntimeError","RUNTIME_ERROR_SCHEMA","isRuntimeError","error","ZodError","ValidationError","VALIDATION_ERROR_SCHEMA","isValidationError"],"mappings":"AAMA,OAAOA,MAAiB,gBACxB,OAAS,KAAAC,MAAS,MAGX,IAAMC,EAAmCF,EAAY,SAAS,eAAgB,CACpF,MAAO,CACN,IAAK,OAAO,WAAW,IACvB,KAAM,OAAO,WAAW,KACxB,QAAS,OAAO,WAAW,QAC3B,OAAQ,OAAO,WAAW,MAC3B,CACD,CAAC,EAEYG,EAA6EF,EAAE,WAAWC,CAAY,EAE5G,SAASE,EAAeC,EAA8C,CAC5E,OAAOF,EAAqB,UAAUE,CAAK,EAAE,OAC9C,CCvBA,OAAS,KAAAJ,EAAG,YAAAK,MAAgB,MAGrB,IAAMC,EAAkBD,EAElBE,EAA0BP,EAAE,WAAWM,CAAe,EAE5D,SAASE,EAAkBJ,EAAiD,CAClF,OAAOG,EAAwB,UAAUH,CAAK,EAAE,OACjD","sourcesContent":["/**\n * FIXME: There's a bug with pnpm and TypeScript, this a workaround.\n *\n * @see {@link https://github.com/microsoft/TypeScript/issues/42873}\n */\nimport type {} from \"modern-errors\";\nimport ModernError from \"modern-errors\";\nimport { z } from \"zod\";\n\n/** Error related to the currently used JavaScript runtime environment. */\nexport const RuntimeError: typeof ModernError = ModernError.subclass(\"RuntimeError\", {\n\tprops: {\n\t\tbun: typeof globalThis.Bun,\n\t\tdeno: typeof globalThis.Deno,\n\t\tprocess: typeof globalThis.process,\n\t\twindow: typeof globalThis.window,\n\t},\n});\n/** @see {@link RuntimeError} */\nexport const RUNTIME_ERROR_SCHEMA: ReturnType<typeof z.instanceof<typeof RuntimeError>> = z.instanceof(RuntimeError);\n/** @see {@link RuntimeError} */\nexport function isRuntimeError(error: unknown): error is typeof RuntimeError {\n\treturn RUNTIME_ERROR_SCHEMA.safeParse(error).success;\n}\n","import { z, ZodError } from \"zod\";\n\n/** Error related to the type validation. */\nexport const ValidationError = ZodError;\n/** @see {@link ValidationError} */\nexport const VALIDATION_ERROR_SCHEMA = z.instanceof(ValidationError);\n/** @see {@link ValidationError} */\nexport function isValidationError(error: unknown): error is typeof ValidationError {\n\treturn VALIDATION_ERROR_SCHEMA.safeParse(error).success;\n}\n"]}