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

@hono/vite-dev-server

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hono/vite-dev-server - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

23

dist/dev-server.js

@@ -56,3 +56,3 @@ import { getRequestListener } from "@hono/node-server";

}
const response = await app.fetch(request, env, {
let response = await app.fetch(request, env, {
waitUntil: async (fn) => fn,

@@ -63,2 +63,7 @@ passThroughOnException: () => {

});
if (!(response instanceof Response)) {
const message = 'The response is not an instance of "Response", but: ' + response;
console.error(message);
response = createErrorResponse(message);
}
if (options?.injectClientScript !== false && response.headers.get("content-type")?.match(/^text\/html/)) {

@@ -77,2 +82,18 @@ const script = '<script>import("/@vite/client")</script>';

}
function escapeHtml(str) {
return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
}
function createErrorResponse(body) {
return new Response(
`<html><body><pre style="white-space:pre-wrap;">${escapeHtml(
body.toString()
)}</pre></body></html>`,
{
status: 500,
headers: {
"content-type": "text/html;charset=utf-8"
}
}
);
}
function injectStringToResponse(response, content) {

@@ -79,0 +100,0 @@ const stream = response.body;

4

package.json
{
"name": "@hono/vite-dev-server",
"description": "Vite dev-server plugin for Hono",
"version": "0.3.2",
"version": "0.3.3",
"types": "dist/index.d.ts",

@@ -77,5 +77,5 @@ "module": "dist/index.js",

"@hono/node-server": "^1.2.0",
"miniflare": "^3.20231016.0",
"miniflare": "^3.20231030.4",
"minimatch": "^9.0.3"
}
}

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