@types/json-stable-stringify
- Version 1.1.0
- Published
- 4.76 kB
- No dependencies
- MIT license
Install
npm i @types/json-stable-stringify
yarn add @types/json-stable-stringify
pnpm add @types/json-stable-stringify
Overview
TypeScript definitions for json-stable-stringify
Index
Functions
function stringify
stringify: (obj: any, opts?: stringify.Comparator | stringify.Options) => string;
Deterministic version of JSON.stringify() so you can get a consistent hash from stringified results.
Returns
Deterministic json result.
Interfaces
interface Options
interface Options {}
property cmp
cmp?: Comparator;
Custom comparator for key
property cycles
cycles?: boolean;
true to allow cycles, by marking the entries as __cycle__.
property replacer
replacer?: Replacer;
Option to replace values to simpler values
property space
space?: string | number;
Indent the output for pretty-printing.
Supported is either a string or a number of spaces.
Type Aliases
type Comparator
type Comparator = (a: Element, b: Element, opts?: { get(k: string): any }) => number;
type Replacer
type Replacer = (key: string, value: any) => any;
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/json-stable-stringify
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/json-stable-stringify)
- HTML<a href="https://www.jsdocs.io/package/@types/json-stable-stringify"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3989 ms. - Missing or incorrect documentation? Open an issue for this package.