1 | # Installation
|
2 | > `npm install --save @types/json-stable-stringify`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for json-stable-stringify (https://github.com/substack/json-stable-stringify).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-stable-stringify.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-stable-stringify/index.d.ts)
|
10 | ````ts
|
11 | // Type definitions for json-stable-stringify 1.0
|
12 | // Project: https://github.com/substack/json-stable-stringify
|
13 | // Definitions by: Matt Frantz <https://github.com/mhfrantz>
|
14 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
15 |
|
16 | declare function stringify(obj: any, opts?: stringify.Comparator | stringify.Options): string;
|
17 |
|
18 | declare namespace stringify {
|
19 | interface Element {
|
20 | key: string;
|
21 | value: any;
|
22 | }
|
23 |
|
24 | type Comparator = (a: Element, b: Element) => number;
|
25 |
|
26 | type Replacer = (key: string, value: any) => any;
|
27 |
|
28 | interface Options {
|
29 | cmp?: Comparator | undefined;
|
30 | space?: number | string | undefined;
|
31 | replacer?: Replacer | undefined;
|
32 | }
|
33 | }
|
34 |
|
35 | export = stringify;
|
36 |
|
37 | ````
|
38 |
|
39 | ### Additional Details
|
40 | * Last updated: Tue, 06 Jul 2021 21:33:48 GMT
|
41 | * Dependencies: none
|
42 | * Global values: none
|
43 |
|
44 | # Credits
|
45 | These definitions were written by [Matt Frantz](https://github.com/mhfrantz).
|
46 |
|
\ | No newline at end of file |