mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
The version 1.1.0 changes the signature of `safeJsonStringify` to make JSON.stringify's formatting and replacing capabilities available see https://github.com/debitoor/safe-json-stringify/releases/tag/v1.1.0
21 lines
692 B
TypeScript
21 lines
692 B
TypeScript
// Type definitions for safe-json-stringify 1.1
|
|
// Project: https://github.com/debitoor/safe-json-stringify
|
|
// Definitions by: Eric Byers <https://github.com/ericbyers>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped"
|
|
// TypeScript Version: 2.3
|
|
|
|
declare namespace safeJsonStringify {
|
|
function ensureProperties(obj: any): object;
|
|
}
|
|
|
|
// see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter
|
|
type ReplacerFn = (key: any, value: any) => any;
|
|
|
|
declare function safeJsonStringify(
|
|
data: object,
|
|
replacer?: ReplacerFn | any[] | null,
|
|
space?: string | number
|
|
): string;
|
|
|
|
export = safeJsonStringify;
|