UNPKG

@busy-hour/blaze

Version:

<h1 align='center'>🔥 Blaze</h1> <div align='center'> An event driven framework for 🔥 Hono.js </div>

19 lines (18 loc) • 575 B
// src/router/validator.ts import { z } from "zod"; import { BlazeConfig } from "../internal/config/instance.js"; import { Logger } from "../internal/logger/index.js"; import { ExternalModule } from "../utils/constant/config/index.js"; var zodApi = BlazeConfig.modules[ExternalModule.ZodApi]; if (zodApi) { zodApi.extendZodWithOpenApi(z); } else { z.ZodType.prototype.openapi = function openapi() { Logger.warn(`Please install "${ExternalModule.ZodApi}" to use OpenAPI.`); const result = new this.constructor(this._def); return result; }; } export { z };