Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hono/zod-validator

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hono/zod-validator - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

5

dist/cjs/index.js

@@ -9,3 +9,6 @@ "use strict";

const hookResult = hook({ data: value, ...result }, c);
if (hookResult instanceof Response || hookResult instanceof Promise) {
if (hookResult &&
(hookResult instanceof Response ||
hookResult instanceof Promise ||
'response' in hookResult)) {
return hookResult;

@@ -12,0 +15,0 @@ }

9

dist/esm/index.d.ts

@@ -1,4 +0,4 @@

import type { Context, MiddlewareHandler, Env, ValidationTargets } from 'hono';
import type { Context, MiddlewareHandler, Env, ValidationTargets, TypedResponse } from 'hono';
import type { z, ZodError } from 'zod';
type Hook<T, E extends Env, P extends string> = (result: {
export type Hook<T, E extends Env, P extends string, O = {}> = (result: {
success: true;

@@ -10,3 +10,3 @@ data: T;

data: T;
}, c: Context<E, P>) => Response | Promise<Response> | void | Promise<Response | void>;
}, c: Context<E, P>) => Response | Promise<Response> | void | Promise<Response | void> | TypedResponse<O> | Promise<TypedResponse<O>> | Promise<TypedResponse<O> | void>;
export declare const zValidator: <T extends z.ZodType<any, z.ZodTypeDef, any>, Target extends keyof ValidationTargets, E extends Env, P extends string, V extends {

@@ -18,3 +18,2 @@ in: { [K in Target]: z.input<T>; };

out: { [K_3 in Target]: z.output<T>; };
}>(target: Target, schema: T, hook?: Hook<z.TypeOf<T>, E, P> | undefined) => MiddlewareHandler<E, P, V>;
export {};
}>(target: Target, schema: T, hook?: Hook<z.TypeOf<T>, E, P, {}> | undefined) => MiddlewareHandler<E, P, V>;

@@ -6,3 +6,6 @@ import { validator } from 'hono/validator';

const hookResult = hook({ data: value, ...result }, c);
if (hookResult instanceof Response || hookResult instanceof Promise) {
if (hookResult &&
(hookResult instanceof Response ||
hookResult instanceof Promise ||
'response' in hookResult)) {
return hookResult;

@@ -9,0 +12,0 @@ }

{
"name": "@hono/zod-validator",
"version": "0.1.5",
"version": "0.1.6",
"description": "Validator middleware using Zod",

@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc