es-toolkit 1.14.0-dev.403 → 1.14.0-dev.405
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/dist/_chunk/{isFunction-Cw_tLG.js → isSymbol-CyBIcg.js} +5 -0
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/index.d.mts +1 -0
- package/dist/compat/index.d.ts +1 -0
- package/dist/compat/index.js +13 -12
- package/dist/compat/index.mjs +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -8
- package/dist/index.mjs +1 -0
- package/dist/predicate/index.d.mts +1 -0
- package/dist/predicate/index.d.ts +1 -0
- package/dist/predicate/index.js +9 -8
- package/dist/predicate/index.mjs +1 -0
- package/dist/predicate/isSymbol.d.mts +11 -0
- package/dist/predicate/isSymbol.d.ts +11 -0
- package/dist/predicate/isSymbol.mjs +5 -0
- package/package.json +1 -1
package/dist/compat/index.d.mts
CHANGED
|
@@ -81,6 +81,7 @@ export { isUndefined } from '../predicate/isUndefined.mjs';
|
|
|
81
81
|
export { isLength } from '../predicate/isLength.mjs';
|
|
82
82
|
export { isFunction } from '../predicate/isFunction.mjs';
|
|
83
83
|
export { isPrimitive } from '../predicate/isPrimitive.mjs';
|
|
84
|
+
export { isSymbol } from '../predicate/isSymbol.mjs';
|
|
84
85
|
export { delay } from '../promise/delay.mjs';
|
|
85
86
|
export { withTimeout } from '../promise/withTimeout.mjs';
|
|
86
87
|
export { camelCase } from '../string/camelCase.mjs';
|
package/dist/compat/index.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ export { isUndefined } from '../predicate/isUndefined.js';
|
|
|
81
81
|
export { isLength } from '../predicate/isLength.js';
|
|
82
82
|
export { isFunction } from '../predicate/isFunction.js';
|
|
83
83
|
export { isPrimitive } from '../predicate/isPrimitive.js';
|
|
84
|
+
export { isSymbol } from '../predicate/isSymbol.js';
|
|
84
85
|
export { delay } from '../promise/delay.js';
|
|
85
86
|
export { withTimeout } from '../promise/withTimeout.js';
|
|
86
87
|
export { camelCase } from '../string/camelCase.js';
|
package/dist/compat/index.js
CHANGED
|
@@ -8,7 +8,7 @@ const function_index = require('../function/index.js');
|
|
|
8
8
|
const math_index = require('../math/index.js');
|
|
9
9
|
const randomInt = require('../_chunk/randomInt-CF7bZK.js');
|
|
10
10
|
const object_index = require('../object/index.js');
|
|
11
|
-
const
|
|
11
|
+
const isSymbol = require('../_chunk/isSymbol-CyBIcg.js');
|
|
12
12
|
const isTypedArray$1 = require('../_chunk/isTypedArray-BBEkFl.js');
|
|
13
13
|
const string_index = require('../string/index.js');
|
|
14
14
|
|
|
@@ -79,7 +79,7 @@ function flattenDepth(value, depth = 1) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
function size(target) {
|
|
82
|
-
if (
|
|
82
|
+
if (isSymbol.isNil(target)) {
|
|
83
83
|
return 0;
|
|
84
84
|
}
|
|
85
85
|
if (target instanceof Map || target instanceof Set) {
|
|
@@ -326,12 +326,12 @@ function isArray(value) {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
function isArguments(value) {
|
|
329
|
-
return value !== null && typeof value === 'object' &&
|
|
329
|
+
return value !== null && typeof value === 'object' && isSymbol.getTag(value) === '[object Arguments]';
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
function isArrayLike(value) {
|
|
333
333
|
return value != null && typeof value !== "function" &&
|
|
334
|
-
|
|
334
|
+
isSymbol.isLength(value.length);
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
function isObjectLike(value) {
|
|
@@ -342,7 +342,7 @@ function isBoolean(x) {
|
|
|
342
342
|
if (x === true || x === false) {
|
|
343
343
|
return true;
|
|
344
344
|
}
|
|
345
|
-
if (typeof x === 'object' && x != null &&
|
|
345
|
+
if (typeof x === 'object' && x != null && isSymbol.getTag(x) === '[object Boolean]') {
|
|
346
346
|
return true;
|
|
347
347
|
}
|
|
348
348
|
return false;
|
|
@@ -570,13 +570,14 @@ exports.omit = object_index.omit;
|
|
|
570
570
|
exports.omitBy = object_index.omitBy;
|
|
571
571
|
exports.pick = object_index.pick;
|
|
572
572
|
exports.pickBy = object_index.pickBy;
|
|
573
|
-
exports.isEqual =
|
|
574
|
-
exports.isFunction =
|
|
575
|
-
exports.isLength =
|
|
576
|
-
exports.isNil =
|
|
577
|
-
exports.isNotNil =
|
|
578
|
-
exports.isNull =
|
|
579
|
-
exports.
|
|
573
|
+
exports.isEqual = isSymbol.isEqual;
|
|
574
|
+
exports.isFunction = isSymbol.isFunction;
|
|
575
|
+
exports.isLength = isSymbol.isLength;
|
|
576
|
+
exports.isNil = isSymbol.isNil;
|
|
577
|
+
exports.isNotNil = isSymbol.isNotNil;
|
|
578
|
+
exports.isNull = isSymbol.isNull;
|
|
579
|
+
exports.isSymbol = isSymbol.isSymbol;
|
|
580
|
+
exports.isUndefined = isSymbol.isUndefined;
|
|
580
581
|
exports.isPrimitive = isTypedArray$1.isPrimitive;
|
|
581
582
|
exports.camelCase = string_index.camelCase;
|
|
582
583
|
exports.capitalize = string_index.capitalize;
|
package/dist/compat/index.mjs
CHANGED
|
@@ -81,6 +81,7 @@ export { isUndefined } from '../predicate/isUndefined.mjs';
|
|
|
81
81
|
export { isLength } from '../predicate/isLength.mjs';
|
|
82
82
|
export { isFunction } from '../predicate/isFunction.mjs';
|
|
83
83
|
export { isPrimitive } from '../predicate/isPrimitive.mjs';
|
|
84
|
+
export { isSymbol } from '../predicate/isSymbol.mjs';
|
|
84
85
|
export { delay } from '../promise/delay.mjs';
|
|
85
86
|
export { withTimeout } from '../promise/withTimeout.mjs';
|
|
86
87
|
export { camelCase } from '../string/camelCase.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -92,6 +92,7 @@ export { isFunction } from './predicate/isFunction.mjs';
|
|
|
92
92
|
export { isTypedArray } from './predicate/isTypedArray.mjs';
|
|
93
93
|
export { isPrimitive } from './predicate/isPrimitive.mjs';
|
|
94
94
|
export { isBoolean } from './predicate/isBoolean.mjs';
|
|
95
|
+
export { isSymbol } from './predicate/isSymbol.mjs';
|
|
95
96
|
export { delay } from './promise/delay.mjs';
|
|
96
97
|
export { withTimeout } from './promise/withTimeout.mjs';
|
|
97
98
|
export { camelCase } from './string/camelCase.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export { isFunction } from './predicate/isFunction.js';
|
|
|
92
92
|
export { isTypedArray } from './predicate/isTypedArray.js';
|
|
93
93
|
export { isPrimitive } from './predicate/isPrimitive.js';
|
|
94
94
|
export { isBoolean } from './predicate/isBoolean.js';
|
|
95
|
+
export { isSymbol } from './predicate/isSymbol.js';
|
|
95
96
|
export { delay } from './promise/delay.js';
|
|
96
97
|
export { withTimeout } from './promise/withTimeout.js';
|
|
97
98
|
export { camelCase } from './string/camelCase.js';
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const function_index = require('./function/index.js');
|
|
|
9
9
|
const math_index = require('./math/index.js');
|
|
10
10
|
const randomInt = require('./_chunk/randomInt-CF7bZK.js');
|
|
11
11
|
const object_index = require('./object/index.js');
|
|
12
|
-
const
|
|
12
|
+
const isSymbol = require('./_chunk/isSymbol-CyBIcg.js');
|
|
13
13
|
const isTypedArray = require('./_chunk/isTypedArray-BBEkFl.js');
|
|
14
14
|
const predicate_index = require('./predicate/index.js');
|
|
15
15
|
const string_index = require('./string/index.js');
|
|
@@ -101,13 +101,14 @@ exports.omit = object_index.omit;
|
|
|
101
101
|
exports.omitBy = object_index.omitBy;
|
|
102
102
|
exports.pick = object_index.pick;
|
|
103
103
|
exports.pickBy = object_index.pickBy;
|
|
104
|
-
exports.isEqual =
|
|
105
|
-
exports.isFunction =
|
|
106
|
-
exports.isLength =
|
|
107
|
-
exports.isNil =
|
|
108
|
-
exports.isNotNil =
|
|
109
|
-
exports.isNull =
|
|
110
|
-
exports.
|
|
104
|
+
exports.isEqual = isSymbol.isEqual;
|
|
105
|
+
exports.isFunction = isSymbol.isFunction;
|
|
106
|
+
exports.isLength = isSymbol.isLength;
|
|
107
|
+
exports.isNil = isSymbol.isNil;
|
|
108
|
+
exports.isNotNil = isSymbol.isNotNil;
|
|
109
|
+
exports.isNull = isSymbol.isNull;
|
|
110
|
+
exports.isSymbol = isSymbol.isSymbol;
|
|
111
|
+
exports.isUndefined = isSymbol.isUndefined;
|
|
111
112
|
exports.isPlainObject = isTypedArray.isPlainObject;
|
|
112
113
|
exports.isPrimitive = isTypedArray.isPrimitive;
|
|
113
114
|
exports.isTypedArray = isTypedArray.isTypedArray;
|
package/dist/index.mjs
CHANGED
|
@@ -92,6 +92,7 @@ export { isFunction } from './predicate/isFunction.mjs';
|
|
|
92
92
|
export { isTypedArray } from './predicate/isTypedArray.mjs';
|
|
93
93
|
export { isPrimitive } from './predicate/isPrimitive.mjs';
|
|
94
94
|
export { isBoolean } from './predicate/isBoolean.mjs';
|
|
95
|
+
export { isSymbol } from './predicate/isSymbol.mjs';
|
|
95
96
|
export { delay } from './promise/delay.mjs';
|
|
96
97
|
export { withTimeout } from './promise/withTimeout.mjs';
|
|
97
98
|
export { camelCase } from './string/camelCase.mjs';
|
package/dist/predicate/index.js
CHANGED
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const isSymbol = require('../_chunk/isSymbol-CyBIcg.js');
|
|
6
6
|
const isTypedArray = require('../_chunk/isTypedArray-BBEkFl.js');
|
|
7
7
|
|
|
8
8
|
function isBoolean(x) {
|
|
9
9
|
return typeof x === 'boolean';
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
exports.isEqual =
|
|
13
|
-
exports.isFunction =
|
|
14
|
-
exports.isLength =
|
|
15
|
-
exports.isNil =
|
|
16
|
-
exports.isNotNil =
|
|
17
|
-
exports.isNull =
|
|
18
|
-
exports.
|
|
12
|
+
exports.isEqual = isSymbol.isEqual;
|
|
13
|
+
exports.isFunction = isSymbol.isFunction;
|
|
14
|
+
exports.isLength = isSymbol.isLength;
|
|
15
|
+
exports.isNil = isSymbol.isNil;
|
|
16
|
+
exports.isNotNil = isSymbol.isNotNil;
|
|
17
|
+
exports.isNull = isSymbol.isNull;
|
|
18
|
+
exports.isSymbol = isSymbol.isSymbol;
|
|
19
|
+
exports.isUndefined = isSymbol.isUndefined;
|
|
19
20
|
exports.isPlainObject = isTypedArray.isPlainObject;
|
|
20
21
|
exports.isPrimitive = isTypedArray.isPrimitive;
|
|
21
22
|
exports.isTypedArray = isTypedArray.isTypedArray;
|
package/dist/predicate/index.mjs
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check whether a value is a symbol.
|
|
3
|
+
*
|
|
4
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `symbol`.
|
|
5
|
+
*
|
|
6
|
+
* @param {unknown} value The value to check.
|
|
7
|
+
* @returns {value is symbol} Returns `true` if `value` is a symbol, else `false`.
|
|
8
|
+
*/
|
|
9
|
+
declare function isSymbol(value: unknown): value is symbol;
|
|
10
|
+
|
|
11
|
+
export { isSymbol };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check whether a value is a symbol.
|
|
3
|
+
*
|
|
4
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `symbol`.
|
|
5
|
+
*
|
|
6
|
+
* @param {unknown} value The value to check.
|
|
7
|
+
* @returns {value is symbol} Returns `true` if `value` is a symbol, else `false`.
|
|
8
|
+
*/
|
|
9
|
+
declare function isSymbol(value: unknown): value is symbol;
|
|
10
|
+
|
|
11
|
+
export { isSymbol };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
3
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
4
|
-
"version": "1.14.0-dev.
|
|
4
|
+
"version": "1.14.0-dev.405+4d46377d",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|