es-toolkit 1.51.0-dev.2088 → 1.51.0-dev.2089
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region src/types/
|
|
1
|
+
//#region src/types/JSONValue.d.ts
|
|
2
2
|
/**
|
|
3
3
|
* Any value that `JSON.parse` can produce.
|
|
4
4
|
*
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
* do not survive a JSON round trip.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* declare function parse(text: string):
|
|
9
|
+
* declare function parse(text: string): JSONValue;
|
|
10
10
|
*
|
|
11
11
|
* const value = parse('{"a":[1,null]}');
|
|
12
12
|
* if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
13
|
-
* const a = value.a; //
|
|
13
|
+
* const a = value.a; // JSONValue
|
|
14
14
|
* }
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* // Use `Record` when you want to accept a JSON object specifically.
|
|
18
|
-
* declare function send(body: Record<string,
|
|
18
|
+
* declare function send(body: Record<string, JSONValue>): void;
|
|
19
19
|
*/
|
|
20
|
-
type
|
|
21
|
-
[key: string]:
|
|
20
|
+
type JSONValue = string | number | boolean | null | JSONValue[] | {
|
|
21
|
+
[key: string]: JSONValue;
|
|
22
22
|
};
|
|
23
23
|
//#endregion
|
|
24
|
-
export {
|
|
24
|
+
export { JSONValue };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region src/types/
|
|
1
|
+
//#region src/types/JSONValue.d.ts
|
|
2
2
|
/**
|
|
3
3
|
* Any value that `JSON.parse` can produce.
|
|
4
4
|
*
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
* do not survive a JSON round trip.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* declare function parse(text: string):
|
|
9
|
+
* declare function parse(text: string): JSONValue;
|
|
10
10
|
*
|
|
11
11
|
* const value = parse('{"a":[1,null]}');
|
|
12
12
|
* if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
13
|
-
* const a = value.a; //
|
|
13
|
+
* const a = value.a; // JSONValue
|
|
14
14
|
* }
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* // Use `Record` when you want to accept a JSON object specifically.
|
|
18
|
-
* declare function send(body: Record<string,
|
|
18
|
+
* declare function send(body: Record<string, JSONValue>): void;
|
|
19
19
|
*/
|
|
20
|
-
type
|
|
21
|
-
[key: string]:
|
|
20
|
+
type JSONValue = string | number | boolean | null | JSONValue[] | {
|
|
21
|
+
[key: string]: JSONValue;
|
|
22
22
|
};
|
|
23
23
|
//#endregion
|
|
24
|
-
export {
|
|
24
|
+
export { JSONValue };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ import { DeepPartial } from "./DeepPartial.mjs";
|
|
|
10
10
|
import { DeepReadonly } from "./DeepReadonly.mjs";
|
|
11
11
|
import { EmptyObject } from "./EmptyObject.mjs";
|
|
12
12
|
import { IsEqual } from "./IsEqual.mjs";
|
|
13
|
-
import {
|
|
13
|
+
import { JSONValue } from "./JSONValue.mjs";
|
|
14
14
|
import { NonEmptyArray } from "./NonEmptyArray.mjs";
|
|
15
15
|
import { Primitive } from "./Primitive.mjs";
|
|
16
16
|
import { SetOptional } from "./SetOptional.mjs";
|
|
@@ -18,4 +18,4 @@ import { SetRequired } from "./SetRequired.mjs";
|
|
|
18
18
|
import { UnknownRecord } from "./UnknownRecord.mjs";
|
|
19
19
|
import { ValueOf } from "./ValueOf.mjs";
|
|
20
20
|
import { Writable } from "./Writable.mjs";
|
|
21
|
-
export { type DeepPartial, type DeepReadonly, type EmptyObject, type IsEqual, type
|
|
21
|
+
export { type DeepPartial, type DeepReadonly, type EmptyObject, type IsEqual, type JSONValue, type Merge, type NonEmptyArray, type ObjectKeys, type Primitive, type SetOptional, type SetRequired, type Simplify, type ToCamelCaseKeys, type ToConstantCaseKeys, type ToKebabCaseKeys, type ToPascalCaseKeys, type ToSnakeCaseKeys, type UnknownRecord, type ValueOf, type Writable };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { DeepPartial } from "./DeepPartial.js";
|
|
|
10
10
|
import { DeepReadonly } from "./DeepReadonly.js";
|
|
11
11
|
import { EmptyObject } from "./EmptyObject.js";
|
|
12
12
|
import { IsEqual } from "./IsEqual.js";
|
|
13
|
-
import {
|
|
13
|
+
import { JSONValue } from "./JSONValue.js";
|
|
14
14
|
import { NonEmptyArray } from "./NonEmptyArray.js";
|
|
15
15
|
import { Primitive } from "./Primitive.js";
|
|
16
16
|
import { SetOptional } from "./SetOptional.js";
|
|
@@ -18,4 +18,4 @@ import { SetRequired } from "./SetRequired.js";
|
|
|
18
18
|
import { UnknownRecord } from "./UnknownRecord.js";
|
|
19
19
|
import { ValueOf } from "./ValueOf.js";
|
|
20
20
|
import { Writable } from "./Writable.js";
|
|
21
|
-
export { type DeepPartial, type DeepReadonly, type EmptyObject, type IsEqual, type
|
|
21
|
+
export { type DeepPartial, type DeepReadonly, type EmptyObject, type IsEqual, type JSONValue, type Merge, type NonEmptyArray, type ObjectKeys, type Primitive, type SetOptional, type SetRequired, type Simplify, type ToCamelCaseKeys, type ToConstantCaseKeys, type ToKebabCaseKeys, type ToPascalCaseKeys, type ToSnakeCaseKeys, type UnknownRecord, type ValueOf, type Writable };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
|
-
"version": "1.51.0-dev.
|
|
3
|
+
"version": "1.51.0-dev.2089+2bb189cf",
|
|
4
4
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
5
5
|
"homepage": "https://es-toolkit.dev",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|