es-toolkit 1.14.0-dev.404 → 1.14.0-dev.406
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 +2 -0
- package/dist/compat/index.d.ts +2 -0
- package/dist/compat/index.js +14 -12
- package/dist/compat/index.mjs +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +10 -8
- package/dist/index.mjs +2 -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/dist/string/index.d.mts +1 -0
- package/dist/string/index.d.ts +1 -0
- package/dist/string/index.js +6 -0
- package/dist/string/index.mjs +1 -0
- package/dist/string/pascalCase.d.mts +17 -0
- package/dist/string/pascalCase.d.ts +17 -0
- package/dist/string/pascalCase.mjs +9 -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';
|
|
@@ -89,6 +90,7 @@ export { kebabCase } from '../string/kebabCase.mjs';
|
|
|
89
90
|
export { lowerCase } from '../string/lowerCase.mjs';
|
|
90
91
|
export { startCase } from '../string/startCase.mjs';
|
|
91
92
|
export { capitalize } from '../string/capitalize.mjs';
|
|
93
|
+
export { pascalCase } from '../string/pascalCase.mjs';
|
|
92
94
|
export { chunk } from './array/chunk.mjs';
|
|
93
95
|
export { concat } from './array/concat.mjs';
|
|
94
96
|
export { difference } from './array/difference.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';
|
|
@@ -89,6 +90,7 @@ export { kebabCase } from '../string/kebabCase.js';
|
|
|
89
90
|
export { lowerCase } from '../string/lowerCase.js';
|
|
90
91
|
export { startCase } from '../string/startCase.js';
|
|
91
92
|
export { capitalize } from '../string/capitalize.js';
|
|
93
|
+
export { pascalCase } from '../string/pascalCase.js';
|
|
92
94
|
export { chunk } from './array/chunk.js';
|
|
93
95
|
export { concat } from './array/concat.js';
|
|
94
96
|
export { difference } from './array/difference.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,18 +570,20 @@ 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;
|
|
583
584
|
exports.kebabCase = string_index.kebabCase;
|
|
584
585
|
exports.lowerCase = string_index.lowerCase;
|
|
586
|
+
exports.pascalCase = string_index.pascalCase;
|
|
585
587
|
exports.snakeCase = string_index.snakeCase;
|
|
586
588
|
exports.startCase = string_index.startCase;
|
|
587
589
|
exports.ary = ary;
|
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';
|
|
@@ -89,6 +90,7 @@ export { kebabCase } from '../string/kebabCase.mjs';
|
|
|
89
90
|
export { lowerCase } from '../string/lowerCase.mjs';
|
|
90
91
|
export { startCase } from '../string/startCase.mjs';
|
|
91
92
|
export { capitalize } from '../string/capitalize.mjs';
|
|
93
|
+
export { pascalCase } from '../string/pascalCase.mjs';
|
|
92
94
|
export { chunk } from './array/chunk.mjs';
|
|
93
95
|
export { concat } from './array/concat.mjs';
|
|
94
96
|
export { difference } from './array/difference.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';
|
|
@@ -100,3 +101,4 @@ export { kebabCase } from './string/kebabCase.mjs';
|
|
|
100
101
|
export { lowerCase } from './string/lowerCase.mjs';
|
|
101
102
|
export { startCase } from './string/startCase.mjs';
|
|
102
103
|
export { capitalize } from './string/capitalize.mjs';
|
|
104
|
+
export { pascalCase } from './string/pascalCase.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';
|
|
@@ -100,3 +101,4 @@ export { kebabCase } from './string/kebabCase.js';
|
|
|
100
101
|
export { lowerCase } from './string/lowerCase.js';
|
|
101
102
|
export { startCase } from './string/startCase.js';
|
|
102
103
|
export { capitalize } from './string/capitalize.js';
|
|
104
|
+
export { pascalCase } from './string/pascalCase.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;
|
|
@@ -116,5 +117,6 @@ exports.camelCase = string_index.camelCase;
|
|
|
116
117
|
exports.capitalize = string_index.capitalize;
|
|
117
118
|
exports.kebabCase = string_index.kebabCase;
|
|
118
119
|
exports.lowerCase = string_index.lowerCase;
|
|
120
|
+
exports.pascalCase = string_index.pascalCase;
|
|
119
121
|
exports.snakeCase = string_index.snakeCase;
|
|
120
122
|
exports.startCase = string_index.startCase;
|
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';
|
|
@@ -100,3 +101,4 @@ export { kebabCase } from './string/kebabCase.mjs';
|
|
|
100
101
|
export { lowerCase } from './string/lowerCase.mjs';
|
|
101
102
|
export { startCase } from './string/startCase.mjs';
|
|
102
103
|
export { capitalize } from './string/capitalize.mjs';
|
|
104
|
+
export { pascalCase } from './string/pascalCase.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/dist/string/index.d.mts
CHANGED
package/dist/string/index.d.ts
CHANGED
package/dist/string/index.js
CHANGED
|
@@ -52,9 +52,15 @@ function startCase(str) {
|
|
|
52
52
|
return result;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
const pascalCase = (str) => {
|
|
56
|
+
const words = getWords(str);
|
|
57
|
+
return words.map(word => capitalize(word)).join('');
|
|
58
|
+
};
|
|
59
|
+
|
|
55
60
|
exports.camelCase = camelCase;
|
|
56
61
|
exports.capitalize = capitalize;
|
|
57
62
|
exports.kebabCase = kebabCase;
|
|
58
63
|
exports.lowerCase = lowerCase;
|
|
64
|
+
exports.pascalCase = pascalCase;
|
|
59
65
|
exports.snakeCase = snakeCase;
|
|
60
66
|
exports.startCase = startCase;
|
package/dist/string/index.mjs
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string to Pascal case.
|
|
3
|
+
*
|
|
4
|
+
* Pascal case is the naming convention in which each word is capitalized and concatenated without any separator characters.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} str - The string that is to be changed to pascal case.
|
|
7
|
+
* @returns {string} - The converted string to Pascal case.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const convertedStr1 = pascalCase('pascalCase') // returns 'PascalCase'
|
|
11
|
+
* const convertedStr2 = pascalCase('some whitespace') // returns 'SomeWhitespace'
|
|
12
|
+
* const convertedStr3 = pascalCase('hyphen-text') // returns 'HyphenText'
|
|
13
|
+
* const convertedStr4 = pascalCase('HTTPRequest') // returns 'HttpRequest'
|
|
14
|
+
*/
|
|
15
|
+
declare const pascalCase: (str: string) => string;
|
|
16
|
+
|
|
17
|
+
export { pascalCase };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string to Pascal case.
|
|
3
|
+
*
|
|
4
|
+
* Pascal case is the naming convention in which each word is capitalized and concatenated without any separator characters.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} str - The string that is to be changed to pascal case.
|
|
7
|
+
* @returns {string} - The converted string to Pascal case.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const convertedStr1 = pascalCase('pascalCase') // returns 'PascalCase'
|
|
11
|
+
* const convertedStr2 = pascalCase('some whitespace') // returns 'SomeWhitespace'
|
|
12
|
+
* const convertedStr3 = pascalCase('hyphen-text') // returns 'HyphenText'
|
|
13
|
+
* const convertedStr4 = pascalCase('HTTPRequest') // returns 'HttpRequest'
|
|
14
|
+
*/
|
|
15
|
+
declare const pascalCase: (str: string) => string;
|
|
16
|
+
|
|
17
|
+
export { pascalCase };
|
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.406+6d84ac35",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|