json-with-bigint 3.3.4 → 3.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/json-with-bigint.d.cts +2 -27
- package/json-with-bigint.d.ts +2 -27
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,9 +24,9 @@ JSONParse(JSONStringify(data)).bigNumber === 9007199254740992n // true
|
|
|
24
24
|
|
|
25
25
|
✔️ No need to change your JSON or the way you want to work with your data
|
|
26
26
|
|
|
27
|
-
✔️ You don't have to memorize this library's API, you already know it. Just skip the dot, and that's it (JSONParse()
|
|
27
|
+
✔️ You don't have to memorize this library's API, you already know it. Just skip the dot, and that's it (`JSONParse()`, `JSONStringify()`)
|
|
28
28
|
|
|
29
|
-
✔️ Parses and stringifies all other values other than big numbers the same way as native JSON methods in JS do. You can just replace every `JSON.parse` and `JSON.
|
|
29
|
+
✔️ Parses and stringifies all other values other than big numbers the same way as native JSON methods in JS do. Signatures match too. You can just replace every `JSON.parse()` and `JSON.strinfigy()` in your project with `JSONParse()` and `JSONStringify()`, and it will work
|
|
30
30
|
|
|
31
31
|
✔️ Correctly parses float numbers and negative numbers
|
|
32
32
|
|
package/json-with-bigint.d.cts
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
[x: string]: Json;
|
|
3
|
-
};
|
|
1
|
+
export const JSONStringify: typeof JSON.stringify;
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type Json =
|
|
8
|
-
| null
|
|
9
|
-
| undefined
|
|
10
|
-
| string
|
|
11
|
-
| number
|
|
12
|
-
| bigint
|
|
13
|
-
| boolean
|
|
14
|
-
| JsonObject
|
|
15
|
-
| {}
|
|
16
|
-
| JsonArray;
|
|
17
|
-
|
|
18
|
-
export function JSONStringify(
|
|
19
|
-
data: Exclude<Json, undefined>,
|
|
20
|
-
space?: string | number
|
|
21
|
-
): string;
|
|
22
|
-
|
|
23
|
-
export function JSONStringify(
|
|
24
|
-
data: undefined,
|
|
25
|
-
space?: string | number
|
|
26
|
-
): undefined;
|
|
27
|
-
|
|
28
|
-
export function JSONParse<T extends Json = Json>(serializedData: string): T;
|
|
3
|
+
export const JSONParse: typeof JSON.parse;
|
package/json-with-bigint.d.ts
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
[x: string]: Json;
|
|
3
|
-
};
|
|
1
|
+
export const JSONStringify: typeof JSON.stringify;
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type Json =
|
|
8
|
-
| null
|
|
9
|
-
| undefined
|
|
10
|
-
| string
|
|
11
|
-
| number
|
|
12
|
-
| bigint
|
|
13
|
-
| boolean
|
|
14
|
-
| JsonObject
|
|
15
|
-
| {}
|
|
16
|
-
| JsonArray;
|
|
17
|
-
|
|
18
|
-
export function JSONStringify(
|
|
19
|
-
data: Exclude<Json, undefined>,
|
|
20
|
-
space?: string | number
|
|
21
|
-
): string;
|
|
22
|
-
|
|
23
|
-
export function JSONStringify(
|
|
24
|
-
data: undefined,
|
|
25
|
-
space?: string | number
|
|
26
|
-
): undefined;
|
|
27
|
-
|
|
28
|
-
export function JSONParse<T extends Json = Json>(serializedData: string): T;
|
|
3
|
+
export const JSONParse: typeof JSON.parse;
|