Files
SnowLuma/.pnpm-store/v11/files/f7/cd223cca7590602abe3dc2faca38d3ac46a061ced25e94eb1f1f7a31da6bd801117d07dfd0daff613a4dc4b5909d4395fb291ce70c7736b2d3c6ca944471a2
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

41 lines
987 B
Plaintext

import { MiddlewareHandler } from "../../types.js";
//#region src/middleware/pretty-json/index.d.ts
interface PrettyOptions {
/**
* Number of spaces for indentation.
* @default 2
*/
space?: number;
/**
* Query conditions for when to Pretty.
* @default 'pretty'
*/
query?: string;
/**
* Force prettification of JSON responses regardless of query parameters.
* @default false
*/
force?: boolean;
}
/**
* Pretty JSON Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/pretty-json}
*
* @param options - The options for the pretty JSON middleware.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
*
* app.use(prettyJSON()) // With options: prettyJSON({ space: 4 })
* app.get('/', (c) => {
* return c.json({ message: 'Hono!' })
* })
* ```
*/
export declare const prettyJSON: (options?: PrettyOptions) => MiddlewareHandler;
//#endregion
export {};