🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@hono/typebox-validator

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hono/typebox-validator - npm Package Compare versions

Comparing version
0.2.4
to
0.2.5
+8
-1
dist/cjs/index.js

@@ -64,5 +64,12 @@ "use strict";

}
return c.json({ success: false, errors: [...value_1.Value.Errors(schema, data)] }, 400);
const errors = Array.from(value_1.Value.Errors(schema, data));
if (hook) {
const hookResult = hook({ success: false, errors }, c);
if (hookResult instanceof Response || hookResult instanceof Promise) {
return hookResult;
}
}
return c.json({ success: false, errors }, 400);
});
}
exports.tbValidator = tbValidator;

@@ -61,4 +61,11 @@ import { Value } from '@sinclair/typebox/value';

}
return c.json({ success: false, errors: [...Value.Errors(schema, data)] }, 400);
const errors = Array.from(Value.Errors(schema, data));
if (hook) {
const hookResult = hook({ success: false, errors }, c);
if (hookResult instanceof Response || hookResult instanceof Promise) {
return hookResult;
}
}
return c.json({ success: false, errors }, 400);
});
}
+1
-1
{
"name": "@hono/typebox-validator",
"version": "0.2.4",
"version": "0.2.5",
"description": "Validator middleware using TypeBox",

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