🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

fastify-zod-schema

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-zod-schema - npm Package Compare versions

Comparing version

to
1.0.4

2

package.json
{
"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