es-toolkit 1.20.0 → 1.21.0-dev.660

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.
Files changed (126) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/_chunk/{isWeakSet-E_VMwB.js → isWeakSet-1xFSnK.js} +5 -0
  3. package/dist/_chunk/{toMerged-Bzkqyz.js → toMerged-D-sLFv.js} +10 -8
  4. package/dist/_chunk/{zipWith-CDtN9Y.js → zipWith-DEcUS4.js} +25 -12
  5. package/dist/array/compact.d.mts +4 -4
  6. package/dist/array/compact.d.ts +4 -4
  7. package/dist/array/compact.mjs +2 -1
  8. package/dist/array/countBy.mjs +2 -1
  9. package/dist/array/flatten.mjs +2 -1
  10. package/dist/array/groupBy.mjs +2 -1
  11. package/dist/array/index.js +1 -1
  12. package/dist/array/keyBy.mjs +2 -1
  13. package/dist/array/maxBy.d.mts +16 -0
  14. package/dist/array/maxBy.d.ts +16 -0
  15. package/dist/array/maxBy.mjs +2 -1
  16. package/dist/array/minBy.d.mts +16 -0
  17. package/dist/array/minBy.d.ts +16 -0
  18. package/dist/array/minBy.mjs +2 -1
  19. package/dist/array/partition.mjs +2 -1
  20. package/dist/array/takeWhile.mjs +2 -1
  21. package/dist/array/unionBy.mjs +3 -1
  22. package/dist/array/uniqBy.mjs +2 -1
  23. package/dist/array/uniqWith.mjs +2 -1
  24. package/dist/browser.global.js +1 -1
  25. package/dist/browser.global.js.map +1 -1
  26. package/dist/compat/array/castArray.d.mts +2 -2
  27. package/dist/compat/array/castArray.d.ts +2 -2
  28. package/dist/compat/array/flatten.mjs +2 -1
  29. package/dist/compat/function/curry.mjs +26 -34
  30. package/dist/compat/function/defer.d.mts +16 -0
  31. package/dist/compat/function/defer.d.ts +16 -0
  32. package/dist/compat/function/defer.mjs +8 -0
  33. package/dist/compat/index.d.mts +13 -5
  34. package/dist/compat/index.d.ts +13 -5
  35. package/dist/compat/index.js +200 -71
  36. package/dist/compat/index.mjs +14 -6
  37. package/dist/compat/math/inRange.d.mts +27 -0
  38. package/dist/compat/math/inRange.d.ts +27 -0
  39. package/dist/compat/math/inRange.mjs +28 -0
  40. package/dist/compat/math/max.mjs +2 -1
  41. package/dist/compat/math/min.mjs +2 -1
  42. package/dist/compat/math/random.d.mts +50 -0
  43. package/dist/compat/math/random.d.ts +50 -0
  44. package/dist/compat/math/random.mjs +70 -0
  45. package/dist/compat/object/cloneDeep.d.mts +49 -0
  46. package/dist/compat/object/cloneDeep.d.ts +49 -0
  47. package/dist/compat/object/pick.mjs +2 -1
  48. package/dist/compat/predicate/conformsTo.mjs +3 -1
  49. package/dist/compat/predicate/isArrayLikeObject.d.mts +15 -0
  50. package/dist/compat/predicate/isArrayLikeObject.d.ts +15 -0
  51. package/dist/compat/predicate/isArrayLikeObject.mjs +8 -0
  52. package/dist/compat/predicate/isBoolean.d.mts +3 -3
  53. package/dist/compat/predicate/isBoolean.d.ts +3 -3
  54. package/dist/compat/predicate/isBoolean.mjs +2 -10
  55. package/dist/compat/predicate/isError.d.mts +16 -0
  56. package/dist/compat/predicate/isError.d.ts +16 -0
  57. package/dist/compat/predicate/isError.mjs +7 -0
  58. package/dist/compat/predicate/isFinite.d.mts +20 -0
  59. package/dist/compat/predicate/isFinite.d.ts +20 -0
  60. package/dist/compat/predicate/isFinite.mjs +5 -0
  61. package/dist/compat/predicate/isNil.d.mts +22 -0
  62. package/dist/compat/predicate/isNil.d.ts +22 -0
  63. package/dist/compat/predicate/isNumber.mjs +1 -6
  64. package/dist/compat/predicate/isRegExp.mjs +2 -2
  65. package/dist/compat/predicate/isString.d.mts +1 -1
  66. package/dist/compat/predicate/isString.d.ts +1 -1
  67. package/dist/compat/predicate/isString.mjs +1 -9
  68. package/dist/compat/predicate/isSymbol.mjs +1 -1
  69. package/dist/compat/string/pad.d.mts +19 -0
  70. package/dist/compat/string/pad.d.ts +19 -0
  71. package/dist/compat/string/pad.mjs +8 -0
  72. package/dist/compat/string/padEnd.mjs +3 -1
  73. package/dist/compat/string/padStart.mjs +3 -1
  74. package/dist/compat/util/toFinite.d.mts +17 -0
  75. package/dist/compat/util/toFinite.d.ts +17 -0
  76. package/dist/compat/util/toFinite.mjs +15 -0
  77. package/dist/compat/util/toInteger.d.mts +17 -0
  78. package/dist/compat/util/toInteger.d.ts +17 -0
  79. package/dist/compat/util/toInteger.mjs +9 -0
  80. package/dist/compat/util/toNumber.d.mts +19 -0
  81. package/dist/compat/util/toNumber.d.ts +19 -0
  82. package/dist/compat/util/toNumber.mjs +10 -0
  83. package/dist/function/curry.d.mts +18 -19
  84. package/dist/function/curry.d.ts +18 -19
  85. package/dist/index.d.mts +2 -0
  86. package/dist/index.d.ts +2 -0
  87. package/dist/index.js +10 -8
  88. package/dist/index.mjs +2 -0
  89. package/dist/math/random.d.mts +1 -1
  90. package/dist/math/random.d.ts +1 -1
  91. package/dist/math/range.d.mts +7 -25
  92. package/dist/math/range.d.ts +7 -25
  93. package/dist/object/index.js +8 -4
  94. package/dist/object/omit.d.mts +1 -1
  95. package/dist/object/omit.d.ts +1 -1
  96. package/dist/object/omit.mjs +2 -1
  97. package/dist/object/omitBy.mjs +5 -4
  98. package/dist/object/pick.mjs +5 -2
  99. package/dist/object/pickBy.mjs +5 -4
  100. package/dist/predicate/index.d.mts +1 -0
  101. package/dist/predicate/index.d.ts +1 -0
  102. package/dist/predicate/index.js +5 -4
  103. package/dist/predicate/index.mjs +1 -0
  104. package/dist/predicate/isError.d.mts +16 -0
  105. package/dist/predicate/isError.d.ts +16 -0
  106. package/dist/predicate/isError.mjs +5 -0
  107. package/dist/promise/withTimeout.d.mts +8 -2
  108. package/dist/promise/withTimeout.d.ts +8 -2
  109. package/dist/string/_internal/getWords.mjs +1 -1
  110. package/dist/string/camelCase.d.mts +1 -0
  111. package/dist/string/camelCase.d.ts +1 -0
  112. package/dist/string/constantCase.d.mts +17 -0
  113. package/dist/string/constantCase.d.ts +17 -0
  114. package/dist/string/constantCase.mjs +8 -0
  115. package/dist/string/index.d.mts +1 -0
  116. package/dist/string/index.d.ts +1 -0
  117. package/dist/string/index.js +10 -8
  118. package/dist/string/index.mjs +1 -0
  119. package/dist/string/startCase.d.mts +1 -1
  120. package/dist/string/startCase.d.ts +1 -1
  121. package/dist/string/startCase.mjs +3 -7
  122. package/dist/string/trimStart.d.mts +1 -1
  123. package/dist/string/trimStart.d.ts +1 -1
  124. package/dist/string/upperFirst.d.mts +3 -3
  125. package/dist/string/upperFirst.d.ts +3 -3
  126. package/package.json +2 -1
@@ -1,5 +1,6 @@
1
1
  export { isDate } from './isDate.mjs';
2
2
  export { isEqual } from './isEqual.mjs';
3
+ export { isError } from './isError.mjs';
3
4
  export { isNil } from './isNil.mjs';
4
5
  export { isNotNil } from './isNotNil.mjs';
5
6
  export { isNull } from './isNull.mjs';
@@ -1,5 +1,6 @@
1
1
  export { isDate } from './isDate.js';
2
2
  export { isEqual } from './isEqual.js';
3
+ export { isError } from './isError.js';
3
4
  export { isNil } from './isNil.js';
4
5
  export { isNotNil } from './isNotNil.js';
5
6
  export { isNull } from './isNull.js';
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const isWeakSet = require('../_chunk/isWeakSet-E_VMwB.js');
5
+ const isWeakSet = require('../_chunk/isWeakSet-1xFSnK.js');
6
6
  const isPlainObject = require('../_chunk/isPlainObject-BIekvL.js');
7
7
 
8
- function isRegExp(value) {
9
- return value instanceof RegExp;
8
+ function isError(value) {
9
+ return value instanceof Error;
10
10
  }
11
11
 
12
12
  function isBoolean(x) {
@@ -28,6 +28,7 @@ exports.isLength = isWeakSet.isLength;
28
28
  exports.isNil = isWeakSet.isNil;
29
29
  exports.isNotNil = isWeakSet.isNotNil;
30
30
  exports.isNull = isWeakSet.isNull;
31
+ exports.isRegExp = isWeakSet.isRegExp;
31
32
  exports.isUndefined = isWeakSet.isUndefined;
32
33
  exports.isWeakMap = isWeakSet.isWeakMap;
33
34
  exports.isWeakSet = isWeakSet.isWeakSet;
@@ -35,6 +36,6 @@ exports.isPlainObject = isPlainObject.isPlainObject;
35
36
  exports.isPrimitive = isPlainObject.isPrimitive;
36
37
  exports.isTypedArray = isPlainObject.isTypedArray;
37
38
  exports.isBoolean = isBoolean;
38
- exports.isRegExp = isRegExp;
39
+ exports.isError = isError;
39
40
  exports.isString = isString;
40
41
  exports.isSymbol = isSymbol;
@@ -1,5 +1,6 @@
1
1
  export { isDate } from './isDate.mjs';
2
2
  export { isEqual } from './isEqual.mjs';
3
+ export { isError } from './isError.mjs';
3
4
  export { isNil } from './isNil.mjs';
4
5
  export { isNotNil } from './isNotNil.mjs';
5
6
  export { isNull } from './isNull.mjs';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Checks if `value` is an Error object.
3
+ *
4
+ * @param {unknown} value The value to check.
5
+ * @returns {value is Error} Returns `true` if `value` is an Error object, `false` otherwise.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * console.log(isError(new Error())); // true
10
+ * console.log(isError('Error')); // false
11
+ * console.log(isError({ name: 'Error', message: '' })); // false
12
+ * ```
13
+ */
14
+ declare function isError(value: unknown): value is Error;
15
+
16
+ export { isError };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Checks if `value` is an Error object.
3
+ *
4
+ * @param {unknown} value The value to check.
5
+ * @returns {value is Error} Returns `true` if `value` is an Error object, `false` otherwise.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * console.log(isError(new Error())); // true
10
+ * console.log(isError('Error')); // false
11
+ * console.log(isError({ name: 'Error', message: '' })); // false
12
+ * ```
13
+ */
14
+ declare function isError(value: unknown): value is Error;
15
+
16
+ export { isError };
@@ -0,0 +1,5 @@
1
+ function isError(value) {
2
+ return value instanceof Error;
3
+ }
4
+
5
+ export { isError };
@@ -11,10 +11,16 @@
11
11
  * @returns {Promise<T>} A promise that resolves with the result of the `run` function or rejects if the timeout is reached.
12
12
  *
13
13
  * @example
14
+ * async function fetchData() {
15
+ * const response = await fetch('https://example.com/data');
16
+ * return response.json();
17
+ * }
18
+ *
14
19
  * try {
15
- * await withTimeout(() => {}, 1000); // Timeout exception after 1 second
20
+ * const data = await withTimeout(fetchData, 1000);
21
+ * console.log(data); // Logs the fetched data if `fetchData` is resolved within 1 second.
16
22
  * } catch (error) {
17
- * console.error(error); // Will log 'TimeoutError'
23
+ * console.error(error); // Will log 'TimeoutError' if `fetchData` is not resolved within 1 second.
18
24
  * }
19
25
  */
20
26
  declare function withTimeout<T>(run: () => Promise<T>, ms: number): Promise<T>;
@@ -11,10 +11,16 @@
11
11
  * @returns {Promise<T>} A promise that resolves with the result of the `run` function or rejects if the timeout is reached.
12
12
  *
13
13
  * @example
14
+ * async function fetchData() {
15
+ * const response = await fetch('https://example.com/data');
16
+ * return response.json();
17
+ * }
18
+ *
14
19
  * try {
15
- * await withTimeout(() => {}, 1000); // Timeout exception after 1 second
20
+ * const data = await withTimeout(fetchData, 1000);
21
+ * console.log(data); // Logs the fetched data if `fetchData` is resolved within 1 second.
16
22
  * } catch (error) {
17
- * console.error(error); // Will log 'TimeoutError'
23
+ * console.error(error); // Will log 'TimeoutError' if `fetchData` is not resolved within 1 second.
18
24
  * }
19
25
  */
20
26
  declare function withTimeout<T>(run: () => Promise<T>, ms: number): Promise<T>;
@@ -1,4 +1,4 @@
1
- const CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;
1
+ const CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;
2
2
  function getWords(str) {
3
3
  return Array.from(str.match(CASE_SPLIT_PATTERN) ?? []);
4
4
  }
@@ -12,6 +12,7 @@
12
12
  * const convertedStr2 = camelCase('some whitespace') // returns 'someWhitespace'
13
13
  * const convertedStr3 = camelCase('hyphen-text') // returns 'hyphenText'
14
14
  * const convertedStr4 = camelCase('HTTPRequest') // returns 'httpRequest'
15
+ * const convertedStr5 = camelCase('Keep unicode 😅') // returns 'keepUnicode😅'
15
16
  */
16
17
  declare function camelCase(str: string): string;
17
18
 
@@ -12,6 +12,7 @@
12
12
  * const convertedStr2 = camelCase('some whitespace') // returns 'someWhitespace'
13
13
  * const convertedStr3 = camelCase('hyphen-text') // returns 'hyphenText'
14
14
  * const convertedStr4 = camelCase('HTTPRequest') // returns 'httpRequest'
15
+ * const convertedStr5 = camelCase('Keep unicode 😅') // returns 'keepUnicode😅'
15
16
  */
16
17
  declare function camelCase(str: string): string;
17
18
 
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Converts a string to constant case.
3
+ *
4
+ * Constant case is a naming convention where each word is written in uppercase letters and separated by an underscore (`_`). For example, `CONSTANT_CASE`.
5
+ *
6
+ * @param {string} str - The string that is to be changed to constant case.
7
+ * @returns {string} - The converted string to constant case.
8
+ *
9
+ * @example
10
+ * const convertedStr1 = constantCase('camelCase') // returns 'CAMEL_CASE'
11
+ * const convertedStr2 = constantCase('some whitespace') // returns 'SOME_WHITESPACE'
12
+ * const convertedStr3 = constantCase('hyphen-text') // returns 'HYPHEN_TEXT'
13
+ * const convertedStr4 = constantCase('HTTPRequest') // returns 'HTTP_REQUEST'
14
+ */
15
+ declare function constantCase(str: string): string;
16
+
17
+ export { constantCase };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Converts a string to constant case.
3
+ *
4
+ * Constant case is a naming convention where each word is written in uppercase letters and separated by an underscore (`_`). For example, `CONSTANT_CASE`.
5
+ *
6
+ * @param {string} str - The string that is to be changed to constant case.
7
+ * @returns {string} - The converted string to constant case.
8
+ *
9
+ * @example
10
+ * const convertedStr1 = constantCase('camelCase') // returns 'CAMEL_CASE'
11
+ * const convertedStr2 = constantCase('some whitespace') // returns 'SOME_WHITESPACE'
12
+ * const convertedStr3 = constantCase('hyphen-text') // returns 'HYPHEN_TEXT'
13
+ * const convertedStr4 = constantCase('HTTPRequest') // returns 'HTTP_REQUEST'
14
+ */
15
+ declare function constantCase(str: string): string;
16
+
17
+ export { constantCase };
@@ -0,0 +1,8 @@
1
+ import { getWords } from './_internal/getWords.mjs';
2
+
3
+ function constantCase(str) {
4
+ const words = getWords(str);
5
+ return words.map(word => word.toUpperCase()).join('_');
6
+ }
7
+
8
+ export { constantCase };
@@ -6,6 +6,7 @@ export { lowerCase } from './lowerCase.mjs';
6
6
  export { startCase } from './startCase.mjs';
7
7
  export { capitalize } from './capitalize.mjs';
8
8
  export { pascalCase } from './pascalCase.mjs';
9
+ export { constantCase } from './constantCase.mjs';
9
10
  export { trim } from './trim.mjs';
10
11
  export { trimStart } from './trimStart.mjs';
11
12
  export { trimEnd } from './trimEnd.mjs';
@@ -6,6 +6,7 @@ export { lowerCase } from './lowerCase.js';
6
6
  export { startCase } from './startCase.js';
7
7
  export { capitalize } from './capitalize.js';
8
8
  export { pascalCase } from './pascalCase.js';
9
+ export { constantCase } from './constantCase.js';
9
10
  export { trim } from './trim.js';
10
11
  export { trimStart } from './trimStart.js';
11
12
  export { trimEnd } from './trimEnd.js';
@@ -6,7 +6,7 @@ function capitalize(str) {
6
6
  return (str.charAt(0).toUpperCase() + str.slice(1).toLowerCase());
7
7
  }
8
8
 
9
- const CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;
9
+ const CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;
10
10
  function getWords(str) {
11
11
  return Array.from(str.match(CASE_SPLIT_PATTERN) ?? []);
12
12
  }
@@ -50,16 +50,12 @@ function lowerCase(str) {
50
50
  function startCase(str) {
51
51
  const words = getWords(str.trim());
52
52
  let result = '';
53
- for (const word of words) {
53
+ for (let i = 0; i < words.length; i++) {
54
+ const word = words[i];
54
55
  if (result) {
55
56
  result += ' ';
56
57
  }
57
- if (word === word.toUpperCase()) {
58
- result += word;
59
- }
60
- else {
61
- result += word[0].toUpperCase() + word.slice(1).toLowerCase();
62
- }
58
+ result += word[0].toUpperCase() + word.slice(1).toLowerCase();
63
59
  }
64
60
  return result;
65
61
  }
@@ -69,6 +65,11 @@ function pascalCase(str) {
69
65
  return words.map(word => capitalize(word)).join('');
70
66
  }
71
67
 
68
+ function constantCase(str) {
69
+ const words = getWords(str);
70
+ return words.map(word => word.toUpperCase()).join('_');
71
+ }
72
+
72
73
  function trimStart(str, chars) {
73
74
  if (chars === undefined) {
74
75
  return str.trimStart();
@@ -202,6 +203,7 @@ function pad(str, length, chars = ' ') {
202
203
 
203
204
  exports.camelCase = camelCase;
204
205
  exports.capitalize = capitalize;
206
+ exports.constantCase = constantCase;
205
207
  exports.deburr = deburr;
206
208
  exports.escape = escape;
207
209
  exports.escapeRegExp = escapeRegExp;
@@ -6,6 +6,7 @@ export { lowerCase } from './lowerCase.mjs';
6
6
  export { startCase } from './startCase.mjs';
7
7
  export { capitalize } from './capitalize.mjs';
8
8
  export { pascalCase } from './pascalCase.mjs';
9
+ export { constantCase } from './constantCase.mjs';
9
10
  export { trim } from './trim.mjs';
10
11
  export { trimStart } from './trimStart.mjs';
11
12
  export { trimEnd } from './trimEnd.mjs';
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @example
9
9
  * const result1 = startCase('hello world'); // result will be 'Hello World'
10
- * const result2 = startCase('HELLO WORLD'); // result will be 'HELLO WORLD'
10
+ * const result2 = startCase('HELLO WORLD'); // result will be 'Hello World'
11
11
  * const result3 = startCase('hello-world'); // result will be 'Hello World'
12
12
  * const result4 = startCase('hello_world'); // result will be 'Hello World'
13
13
  */
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @example
9
9
  * const result1 = startCase('hello world'); // result will be 'Hello World'
10
- * const result2 = startCase('HELLO WORLD'); // result will be 'HELLO WORLD'
10
+ * const result2 = startCase('HELLO WORLD'); // result will be 'Hello World'
11
11
  * const result3 = startCase('hello-world'); // result will be 'Hello World'
12
12
  * const result4 = startCase('hello_world'); // result will be 'Hello World'
13
13
  */
@@ -3,16 +3,12 @@ import { getWords } from './_internal/getWords.mjs';
3
3
  function startCase(str) {
4
4
  const words = getWords(str.trim());
5
5
  let result = '';
6
- for (const word of words) {
6
+ for (let i = 0; i < words.length; i++) {
7
+ const word = words[i];
7
8
  if (result) {
8
9
  result += ' ';
9
10
  }
10
- if (word === word.toUpperCase()) {
11
- result += word;
12
- }
13
- else {
14
- result += word[0].toUpperCase() + word.slice(1).toLowerCase();
15
- }
11
+ result += word[0].toUpperCase() + word.slice(1).toLowerCase();
16
12
  }
17
13
  return result;
18
14
  }
@@ -2,7 +2,7 @@
2
2
  * Removes leading whitespace or specified characters from a string.
3
3
  *
4
4
  * @param {string} str - The string from which leading characters will be trimmed.
5
- * @param {string | string[]} chars - The character(s) to remove from the end of the string.
5
+ * @param {string | string[]} chars - The character(s) to remove from the start of the string.
6
6
  * @returns {string} - The resulting string after the specified leading character has been removed.
7
7
  *
8
8
  * @example
@@ -2,7 +2,7 @@
2
2
  * Removes leading whitespace or specified characters from a string.
3
3
  *
4
4
  * @param {string} str - The string from which leading characters will be trimmed.
5
- * @param {string | string[]} chars - The character(s) to remove from the end of the string.
5
+ * @param {string | string[]} chars - The character(s) to remove from the start of the string.
6
6
  * @returns {string} - The resulting string after the specified leading character has been removed.
7
7
  *
8
8
  * @example
@@ -5,9 +5,9 @@
5
5
  * @returns {string} - The converted string.
6
6
  *
7
7
  * @example
8
- * const convertedStr1 = upperCase('fred') // returns 'fred'
9
- * const convertedStr2 = upperCase('Fred') // returns 'Fred'
10
- * const convertedStr3 = upperCase('FRED') // returns 'FRED'
8
+ * const convertedStr1 = upperFirst('fred') // returns 'Fred'
9
+ * const convertedStr2 = upperFirst('Fred') // returns 'Fred'
10
+ * const convertedStr3 = upperFirst('FRED') // returns 'FRED'
11
11
  */
12
12
  declare function upperFirst(str: string): string;
13
13
 
@@ -5,9 +5,9 @@
5
5
  * @returns {string} - The converted string.
6
6
  *
7
7
  * @example
8
- * const convertedStr1 = upperCase('fred') // returns 'fred'
9
- * const convertedStr2 = upperCase('Fred') // returns 'Fred'
10
- * const convertedStr3 = upperCase('FRED') // returns 'FRED'
8
+ * const convertedStr1 = upperFirst('fred') // returns 'Fred'
9
+ * const convertedStr2 = upperFirst('Fred') // returns 'Fred'
10
+ * const convertedStr3 = upperFirst('FRED') // returns 'FRED'
11
11
  */
12
12
  declare function upperFirst(str: string): string;
13
13
 
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.20.0",
4
+ "version": "1.21.0-dev.660+d2164703",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {
@@ -228,6 +228,7 @@
228
228
  "eslint": "^9.9.0",
229
229
  "eslint-config-prettier": "^9.1.0",
230
230
  "eslint-plugin-jsdoc": "^50.2.2",
231
+ "eslint-plugin-no-for-of-array": "^0.0.1",
231
232
  "eslint-plugin-vue": "^9.28.0",
232
233
  "execa": "^9.3.0",
233
234
  "globals": "^15.9.0",