{"version":3,"sources":["jsdelivr-header.js","/npm/@hono/zod-validator@0.2.2/dist/cjs/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,QAAQ,gBAAa,EACrB,MAAM,YAAc,QAAQ,kBACtB,WAAa,CAAC,EAAQ,EAAQ,KAEpC,EAAI,YAAY,WAAW,GAAQ,MAAO,EAAO,KAC7C,MAAM,QAAe,EAAO,eAAe,GAC3C,GAAI,EAAM,CACN,MAAM,QAAmB,EAAK,CAAE,KAAM,KAAU,GAAU,GAC1D,GAAI,EAAY,CACZ,GAAI,aAAsB,SACtB,OAAO,EAEX,GAAI,aAAc,EACd,OAAO,EAAW,QAE1B,CACJ,CACA,OAAK,EAAO,QAGL,EAAO,KAFH,EAAE,KAAK,EAAQ,IAER,IAEtB,QAAQ,WAAa","file":"/npm/@hono/zod-validator@0.2.2/dist/cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@hono/zod-validator@0.2.2/dist/cjs/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.zValidator = void 0;\nconst validator_1 = require(\"hono/validator\");\nconst zValidator = (target, schema, hook) => \n// @ts-expect-error not typed well\n(0, validator_1.validator)(target, async (value, c) => {\n    const result = await schema.safeParseAsync(value);\n    if (hook) {\n        const hookResult = await hook({ data: value, ...result }, c);\n        if (hookResult) {\n            if (hookResult instanceof Response) {\n                return hookResult;\n            }\n            if ('response' in hookResult) {\n                return hookResult.response;\n            }\n        }\n    }\n    if (!result.success) {\n        return c.json(result, 400);\n    }\n    return result.data;\n});\nexports.zValidator = zValidator;\n"]}