New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.2.2 to 0.3.0

2

dist/cjs/index.js

@@ -10,3 +10,3 @@ "use strict";

if (hook) {
const hookResult = await hook({ data: value, ...result }, c);
const hookResult = await hook({ data: value, ...result, target }, c);
if (hookResult) {

@@ -13,0 +13,0 @@ if (hookResult instanceof Response) {

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

@@ -10,2 +10,4 @@ data: T;

data: T;
}) & {
target: Target;
}, c: Context<E, P>) => Response | void | TypedResponse<O> | Promise<Response | void | TypedResponse<O>>;

@@ -16,3 +18,3 @@ type HasUndefined<T> = undefined extends T ? true : false;

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

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

if (hook) {
const hookResult = await hook({ data: value, ...result }, c);
const hookResult = await hook({ data: value, ...result, target }, c);
if (hookResult) {

@@ -10,0 +10,0 @@ if (hookResult instanceof Response) {

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

@@ -5,0 +5,0 @@ "type": "module",

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