fastify-zod-schema
Advanced tools
Comparing version
{ | ||
"name": "fastify-zod-schema", | ||
"version": "1.0.2", | ||
"version": "1.0.4", | ||
"description": "A Fastify plugin that allows users to define request schemas using Zod, providing type safety and validation.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
import type { FastifyInstance } from 'fastify'; | ||
import './modules'; | ||
declare function registerZod(fastify: FastifyInstance, params: any, done: (err?: any) => void): void; | ||
export { registerZod }; | ||
declare function zodSchemaPlugin(fastify: FastifyInstance, params: any, done: (err?: any) => void): void; | ||
export { zodSchemaPlugin }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,7 +6,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.registerZod = void 0; | ||
exports.zodSchemaPlugin = void 0; | ||
const fast_json_stringify_1 = __importDefault(require("fast-json-stringify")); | ||
const zod_to_json_schema_1 = require("zod-to-json-schema"); | ||
require("./modules"); | ||
function registerZod(fastify, params, done) { | ||
function zodSchemaPlugin(fastify, params, done) { | ||
fastify.setValidatorCompiler(({ schema, method, url, httpPart }) => { | ||
@@ -33,4 +33,4 @@ return data => { | ||
} | ||
exports.registerZod = registerZod; | ||
exports.zodSchemaPlugin = zodSchemaPlugin; | ||
//@ts-ignore | ||
registerZod[Symbol.for('skip-override')] = true; | ||
zodSchemaPlugin[Symbol.for('skip-override')] = true; |
@@ -7,4 +7,3 @@ import type { FastifyInstance } from 'fastify' | ||
function registerZod(fastify: FastifyInstance, params: any, done: (err?: any) => void) { | ||
function zodSchemaPlugin(fastify: FastifyInstance, params: any, done: (err?: any) => void) { | ||
fastify.setValidatorCompiler<z.Schema>(({ schema, method, url, httpPart }) => { | ||
@@ -35,3 +34,3 @@ return data => { | ||
//@ts-ignore | ||
registerZod[Symbol.for('skip-override')] = true | ||
export { registerZod } | ||
zodSchemaPlugin[Symbol.for('skip-override')] = true | ||
export { zodSchemaPlugin } |
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
8389
0.47%1
Infinity%