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

hono

Package Overview
Dependencies
Maintainers
1
Versions
343
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hono - npm Package Compare versions

Comparing version 0.5.9 to 0.5.10

dist/middleware/pretty-json/pretty-json.d.ts

3

dist/context.d.ts

@@ -15,2 +15,3 @@ /// <reference types="@cloudflare/workers-types" />

private _pretty;
private _prettySpace;
render: (template: string, params?: object, options?: object) => Promise<Response>;

@@ -25,3 +26,3 @@ notFound: () => Response | Promise<Response>;

status(number: number): void;
pretty(prettyJSON: boolean): void;
pretty(prettyJSON: boolean, space?: number): void;
newResponse(data: Data, init?: ResponseInit): Response;

@@ -28,0 +29,0 @@ body(data: Data, status?: number, headers?: Headers): Response;

@@ -8,2 +8,3 @@ "use strict";

constructor(req, opts) {
this._prettySpace = 2;
this.req = req;

@@ -38,4 +39,5 @@ if (opts) {

}
pretty(prettyJSON) {
pretty(prettyJSON, space = 2) {
this._pretty = prettyJSON;
this._prettySpace = space;
}

@@ -77,3 +79,5 @@ newResponse(data, init = {}) {

}
const body = this._pretty ? JSON.stringify(object, null, 2) : JSON.stringify(object);
const body = this._pretty
? JSON.stringify(object, null, this._prettySpace)
: JSON.stringify(object);
headers['Content-Type'] || (headers['Content-Type'] = 'application/json; charset=UTF-8');

@@ -80,0 +84,0 @@ return this.body(body, status, headers);

{
"name": "hono",
"version": "0.5.9",
"version": "0.5.10",
"description": "[炎] Ultrafast web framework for Cloudflare Workers.",

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

"./powered-by": "./dist/middleware/powered-by/powered-by.js",
"./pretty-json": "./dist/middleware/pretty-json/pretty-json.js",
"./serve-static": "./dist/middleware/serve-static/serve-static.js",

@@ -65,2 +66,5 @@ "./router/trie-router": "./dist/router/trie-router/router.js",

],
"pretty-json": [
"./dist/middleware/pretty-json/pretty-json.d.ts"
],
"serve-static": [

@@ -67,0 +71,0 @@ "./dist/middleware/serve-static/serve-static.d.ts"

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