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 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(), JSONStringify())
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.stringify` call in your project with functions from this library and it'll work.
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
 
@@ -1,28 +1,3 @@
1
- type JsonObject = {
2
- [x: string]: Json;
3
- };
1
+ export const JSONStringify: typeof JSON.stringify;
4
2
 
5
- type JsonArray = Json[];
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;
@@ -1,28 +1,3 @@
1
- type JsonObject = {
2
- [x: string]: Json;
3
- };
1
+ export const JSONStringify: typeof JSON.stringify;
4
2
 
5
- type JsonArray = Json[];
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-with-bigint",
3
- "version": "3.3.4",
3
+ "version": "3.4.4",
4
4
  "description": "JS library that allows you to easily serialize and deserialize data with BigInt values",
5
5
  "type": "module",
6
6
  "exports": {