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

@hono/zod-openapi

Package Overview
Dependencies
Maintainers
0
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hono/zod-openapi - npm Package Compare versions

Comparing version 0.15.1 to 0.15.2

32

dist/index.js

@@ -102,9 +102,27 @@ "use strict";

}
if (/^application\/([a-z-\.]+\+)?json/.test(mediaType)) {
if (isJSONContentType(mediaType)) {
const validator = (0, import_zod_validator.zValidator)("json", schema, hook);
validators.push(validator);
const mw = async (c, next) => {
if (c.req.header("content-type")) {
if (isJSONContentType(c.req.header("content-type"))) {
return await validator(c, next);
}
}
c.req.addValidatedData("json", {});
await next();
};
validators.push(mw);
}
if (mediaType.startsWith("multipart/form-data") || mediaType.startsWith("application/x-www-form-urlencoded")) {
if (isFormContentType(mediaType)) {
const validator = (0, import_zod_validator.zValidator)("form", schema, hook);
validators.push(validator);
const mw = async (c, next) => {
if (c.req.header("content-type")) {
if (isFormContentType(c.req.header("content-type"))) {
return await validator(c, next);
}
}
c.req.addValidatedData("form", {});
await next();
};
validators.push(mw);
}

@@ -214,2 +232,8 @@ }

}
function isJSONContentType(contentType) {
return /^application\/([a-z-\.]+\+)?json/.test(contentType);
}
function isFormContentType(contentType) {
return contentType.startsWith("multipart/form-data") || contentType.startsWith("application/x-www-form-urlencoded");
}
// Annotate the CommonJS export names for ESM import in node:

@@ -216,0 +240,0 @@ 0 && (module.exports = {

4

package.json
{
"name": "@hono/zod-openapi",
"version": "0.15.1",
"version": "0.15.2",
"description": "A wrapper class of Hono which supports OpenAPI.",

@@ -45,3 +45,3 @@ "main": "dist/index.js",

"@cloudflare/workers-types": "^4.20240117.0",
"hono": "^4.3.6",
"hono": "^4.5.4",
"jest": "^29.7.0",

@@ -48,0 +48,0 @@ "tsup": "^8.0.1",

@@ -272,3 +272,3 @@ # Zod OpenAPI Hono

import { prettyJSON } from 'hono/pretty-json'
import { cache } from 'honoc/cache'
import { cache } from 'hono/cache'

@@ -275,0 +275,0 @@ app.use(route.getRoutingPath(), prettyJSON(), cache({ cacheName: 'my-cache' }))

Sorry, the diff of this file is not supported yet

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