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.
@@ -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';
@@ -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';
@@ -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 isFunction = require('../_chunk/isFunction-Cw_tLG.js');
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 (isFunction.isNil(target)) {
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' && isFunction.getTag(value) === '[object Arguments]';
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
- isFunction.isLength(value.length);
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 && isFunction.getTag(x) === '[object Boolean]') {
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 = isFunction.isEqual;
574
- exports.isFunction = isFunction.isFunction;
575
- exports.isLength = isFunction.isLength;
576
- exports.isNil = isFunction.isNil;
577
- exports.isNotNil = isFunction.isNotNil;
578
- exports.isNull = isFunction.isNull;
579
- exports.isUndefined = isFunction.isUndefined;
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;
@@ -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 isFunction = require('./_chunk/isFunction-Cw_tLG.js');
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 = isFunction.isEqual;
105
- exports.isFunction = isFunction.isFunction;
106
- exports.isLength = isFunction.isLength;
107
- exports.isNil = isFunction.isNil;
108
- exports.isNotNil = isFunction.isNotNil;
109
- exports.isNull = isFunction.isNull;
110
- exports.isUndefined = isFunction.isUndefined;
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';
@@ -9,3 +9,4 @@ export { isFunction } from './isFunction.mjs';
9
9
  export { isTypedArray } from './isTypedArray.mjs';
10
10
  export { isPrimitive } from './isPrimitive.mjs';
11
11
  export { isBoolean } from './isBoolean.mjs';
12
+ export { isSymbol } from './isSymbol.mjs';
@@ -9,3 +9,4 @@ export { isFunction } from './isFunction.js';
9
9
  export { isTypedArray } from './isTypedArray.js';
10
10
  export { isPrimitive } from './isPrimitive.js';
11
11
  export { isBoolean } from './isBoolean.js';
12
+ export { isSymbol } from './isSymbol.js';
@@ -2,20 +2,21 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const isFunction = require('../_chunk/isFunction-Cw_tLG.js');
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 = isFunction.isEqual;
13
- exports.isFunction = isFunction.isFunction;
14
- exports.isLength = isFunction.isLength;
15
- exports.isNil = isFunction.isNil;
16
- exports.isNotNil = isFunction.isNotNil;
17
- exports.isNull = isFunction.isNull;
18
- exports.isUndefined = isFunction.isUndefined;
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;
@@ -9,3 +9,4 @@ export { isFunction } from './isFunction.mjs';
9
9
  export { isTypedArray } from './isTypedArray.mjs';
10
10
  export { isPrimitive } from './isPrimitive.mjs';
11
11
  export { isBoolean } from './isBoolean.mjs';
12
+ export { isSymbol } from './isSymbol.mjs';
@@ -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 };
@@ -0,0 +1,5 @@
1
+ function isSymbol(value) {
2
+ return typeof value === 'symbol';
3
+ }
4
+
5
+ export { isSymbol };
@@ -4,3 +4,4 @@ export { kebabCase } from './kebabCase.mjs';
4
4
  export { lowerCase } from './lowerCase.mjs';
5
5
  export { startCase } from './startCase.mjs';
6
6
  export { capitalize } from './capitalize.mjs';
7
+ export { pascalCase } from './pascalCase.mjs';
@@ -4,3 +4,4 @@ export { kebabCase } from './kebabCase.js';
4
4
  export { lowerCase } from './lowerCase.js';
5
5
  export { startCase } from './startCase.js';
6
6
  export { capitalize } from './capitalize.js';
7
+ export { pascalCase } from './pascalCase.js';
@@ -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;
@@ -4,3 +4,4 @@ export { kebabCase } from './kebabCase.mjs';
4
4
  export { lowerCase } from './lowerCase.mjs';
5
5
  export { startCase } from './startCase.mjs';
6
6
  export { capitalize } from './capitalize.mjs';
7
+ export { pascalCase } from './pascalCase.mjs';
@@ -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 };
@@ -0,0 +1,9 @@
1
+ import { getWords } from './_internal/getWords.mjs';
2
+ import { capitalize } from './capitalize.mjs';
3
+
4
+ const pascalCase = (str) => {
5
+ const words = getWords(str);
6
+ return words.map(word => capitalize(word)).join('');
7
+ };
8
+
9
+ 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.404+bfddc0f5",
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": {