UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

38 lines (37 loc) 1.99 kB
/** Note: try to avoid non-type imports in this file, it can easily cause circular imports. */ import type { ImmutableArray } from "./array.js"; import type { ImmutableMap } from "./map.js"; import type { ImmutableSet } from "./set.js"; /** Debug a random value as a string. */ export declare function debug(value: unknown, depth?: number): string; /** Debug a string. */ export declare const debugString: (value: string) => string; /** Debug a set of `Headers` as a string. */ export declare function debugHeaders(headers: Headers): string; /** * Debug a full `Request` as a string including its body. * - Clones the request before reading the body so the original request can still be sent or parsed later. * - Omits the body section when the request body is empty. */ export declare function debugFullRequest(request: Request): Promise<string>; /** * Debug a full `Response` as a string including its headers and body. * - Clones the response before reading the body so the original response can still be parsed later. * - Omits the headers section when there are no headers. * - Omits the body section when the response body is empty. */ export declare function debugFullResponse(response: Response): Promise<string>; /** Debug a `Request` as a string. */ export declare function debugRequest(request: Request): string; /** Debug a `Response` as a string. */ export declare function debugResponse(response: Response): string; /** Debug an array. */ export declare function debugArray(value: ImmutableArray, depth?: number): string; /** Debug a set. */ export declare function debugSet(value: ImmutableSet, depth?: number): string; /** Debug a map. */ export declare function debugMap(value: ImmutableMap, depth?: number): string; /** Debug an object. */ export declare function debugObject(value: object, depth?: number): string; /** If a string is multiline, push it onto the next line and prepend a tab to each line.. */ export declare function indent(str: string): string;