es-toolkit 1.29.0-dev.940 → 1.29.0-dev.942

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.
@@ -68,12 +68,9 @@ export { timeout } from '../promise/timeout.mjs';
68
68
  export { withTimeout } from '../promise/withTimeout.mjs';
69
69
  export { capitalize } from '../string/capitalize.mjs';
70
70
  export { constantCase } from '../string/constantCase.mjs';
71
- export { deburr } from '../string/deburr.mjs';
72
71
  export { escapeRegExp } from '../string/escapeRegExp.mjs';
73
- export { lowerFirst } from '../string/lowerFirst.mjs';
74
72
  export { pascalCase } from '../string/pascalCase.mjs';
75
73
  export { unescape } from '../string/unescape.mjs';
76
- export { upperFirst } from '../string/upperFirst.mjs';
77
74
  export { invariant } from '../util/invariant.mjs';
78
75
  export { castArray } from './array/castArray.mjs';
79
76
  export { chunk } from './array/chunk.mjs';
@@ -206,10 +203,12 @@ export { isWeakSet } from './predicate/isWeakSet.mjs';
206
203
  export { matches } from './predicate/matches.mjs';
207
204
  export { matchesProperty } from './predicate/matchesProperty.mjs';
208
205
  export { camelCase } from './string/camelCase.mjs';
206
+ export { deburr } from './string/deburr.mjs';
209
207
  export { endsWith } from './string/endsWith.mjs';
210
208
  export { escape } from './string/escape.mjs';
211
209
  export { kebabCase } from './string/kebabCase.mjs';
212
210
  export { lowerCase } from './string/lowerCase.mjs';
211
+ export { lowerFirst } from './string/lowerFirst.mjs';
213
212
  export { pad } from './string/pad.mjs';
214
213
  export { padEnd } from './string/padEnd.mjs';
215
214
  export { padStart } from './string/padStart.mjs';
@@ -225,6 +224,7 @@ export { trim } from './string/trim.mjs';
225
224
  export { trimEnd } from './string/trimEnd.mjs';
226
225
  export { trimStart } from './string/trimStart.mjs';
227
226
  export { upperCase } from './string/upperCase.mjs';
227
+ export { upperFirst } from './string/upperFirst.mjs';
228
228
  export { words } from './string/words.mjs';
229
229
  export { constant } from './util/constant.mjs';
230
230
  export { defaultTo } from './util/defaultTo.mjs';
@@ -68,12 +68,9 @@ export { timeout } from '../promise/timeout.js';
68
68
  export { withTimeout } from '../promise/withTimeout.js';
69
69
  export { capitalize } from '../string/capitalize.js';
70
70
  export { constantCase } from '../string/constantCase.js';
71
- export { deburr } from '../string/deburr.js';
72
71
  export { escapeRegExp } from '../string/escapeRegExp.js';
73
- export { lowerFirst } from '../string/lowerFirst.js';
74
72
  export { pascalCase } from '../string/pascalCase.js';
75
73
  export { unescape } from '../string/unescape.js';
76
- export { upperFirst } from '../string/upperFirst.js';
77
74
  export { invariant } from '../util/invariant.js';
78
75
  export { castArray } from './array/castArray.js';
79
76
  export { chunk } from './array/chunk.js';
@@ -206,10 +203,12 @@ export { isWeakSet } from './predicate/isWeakSet.js';
206
203
  export { matches } from './predicate/matches.js';
207
204
  export { matchesProperty } from './predicate/matchesProperty.js';
208
205
  export { camelCase } from './string/camelCase.js';
206
+ export { deburr } from './string/deburr.js';
209
207
  export { endsWith } from './string/endsWith.js';
210
208
  export { escape } from './string/escape.js';
211
209
  export { kebabCase } from './string/kebabCase.js';
212
210
  export { lowerCase } from './string/lowerCase.js';
211
+ export { lowerFirst } from './string/lowerFirst.js';
213
212
  export { pad } from './string/pad.js';
214
213
  export { padEnd } from './string/padEnd.js';
215
214
  export { padStart } from './string/padStart.js';
@@ -225,6 +224,7 @@ export { trim } from './string/trim.js';
225
224
  export { trimEnd } from './string/trimEnd.js';
226
225
  export { trimStart } from './string/trimStart.js';
227
226
  export { upperCase } from './string/upperCase.js';
227
+ export { upperFirst } from './string/upperFirst.js';
228
228
  export { words } from './string/words.js';
229
229
  export { constant } from './util/constant.js';
230
230
  export { defaultTo } from './util/defaultTo.js';
@@ -11,7 +11,7 @@ const randomInt = require('../_chunk/randomInt-CF7bZK.js');
11
11
  const toMerged = require('../_chunk/toMerged-DGFrN7.js');
12
12
  const isPlainObject$1 = require('../_chunk/isPlainObject-octpoD.js');
13
13
  const isWeakSet$1 = require('../_chunk/isWeakSet-CvIdTA.js');
14
- const upperFirst = require('../_chunk/upperFirst-CorAVn.js');
14
+ const upperFirst$1 = require('../_chunk/upperFirst-CorAVn.js');
15
15
  const util_index = require('../util/index.js');
16
16
 
17
17
  function castArray(value) {
@@ -2508,7 +2508,11 @@ function normalizeForCase(str) {
2508
2508
  }
2509
2509
 
2510
2510
  function camelCase(str) {
2511
- return upperFirst.camelCase(normalizeForCase(str));
2511
+ return upperFirst$1.camelCase(normalizeForCase(str));
2512
+ }
2513
+
2514
+ function deburr(str) {
2515
+ return upperFirst$1.deburr(toString(str));
2512
2516
  }
2513
2517
 
2514
2518
  function endsWith(str, target, position = str.length) {
@@ -2516,19 +2520,23 @@ function endsWith(str, target, position = str.length) {
2516
2520
  }
2517
2521
 
2518
2522
  function escape(string) {
2519
- return upperFirst.escape(toString(string));
2523
+ return upperFirst$1.escape(toString(string));
2520
2524
  }
2521
2525
 
2522
2526
  function kebabCase(str) {
2523
- return upperFirst.kebabCase(normalizeForCase(str));
2527
+ return upperFirst$1.kebabCase(normalizeForCase(str));
2524
2528
  }
2525
2529
 
2526
2530
  function lowerCase(str) {
2527
- return upperFirst.lowerCase(normalizeForCase(str));
2531
+ return upperFirst$1.lowerCase(normalizeForCase(str));
2532
+ }
2533
+
2534
+ function lowerFirst(str) {
2535
+ return upperFirst$1.lowerFirst(toString(str));
2528
2536
  }
2529
2537
 
2530
2538
  function pad(str, length, chars = ' ') {
2531
- return upperFirst.pad(toString(str), length, chars);
2539
+ return upperFirst$1.pad(toString(str), length, chars);
2532
2540
  }
2533
2541
 
2534
2542
  function padEnd(str, length = 0, chars = ' ') {
@@ -2551,11 +2559,11 @@ function replace(target = '', pattern, replacement) {
2551
2559
  }
2552
2560
 
2553
2561
  function snakeCase(str) {
2554
- return upperFirst.snakeCase(normalizeForCase(str));
2562
+ return upperFirst$1.snakeCase(normalizeForCase(str));
2555
2563
  }
2556
2564
 
2557
2565
  function startCase(str) {
2558
- const words = upperFirst.words(normalizeForCase(str).trim());
2566
+ const words = upperFirst$1.words(normalizeForCase(str).trim());
2559
2567
  let result = '';
2560
2568
  for (let i = 0; i < words.length; i++) {
2561
2569
  const word = words[i];
@@ -2673,14 +2681,14 @@ function trim(str, chars, guard) {
2673
2681
  }
2674
2682
  switch (typeof chars) {
2675
2683
  case 'string': {
2676
- return upperFirst.trim(str, chars.toString().split(''));
2684
+ return upperFirst$1.trim(str, chars.toString().split(''));
2677
2685
  }
2678
2686
  case 'object': {
2679
2687
  if (Array.isArray(chars)) {
2680
- return upperFirst.trim(str, chars.flatMap(x => x.toString().split('')));
2688
+ return upperFirst$1.trim(str, chars.flatMap(x => x.toString().split('')));
2681
2689
  }
2682
2690
  else {
2683
- return upperFirst.trim(str, chars.toString().split(''));
2691
+ return upperFirst$1.trim(str, chars.toString().split(''));
2684
2692
  }
2685
2693
  }
2686
2694
  }
@@ -2695,14 +2703,14 @@ function trimEnd(str, chars, guard) {
2695
2703
  }
2696
2704
  switch (typeof chars) {
2697
2705
  case 'string': {
2698
- return upperFirst.trimEnd(str, chars.toString().split(''));
2706
+ return upperFirst$1.trimEnd(str, chars.toString().split(''));
2699
2707
  }
2700
2708
  case 'object': {
2701
2709
  if (Array.isArray(chars)) {
2702
- return upperFirst.trimEnd(str, chars.flatMap(x => x.toString().split('')));
2710
+ return upperFirst$1.trimEnd(str, chars.flatMap(x => x.toString().split('')));
2703
2711
  }
2704
2712
  else {
2705
- return upperFirst.trimEnd(str, chars.toString().split(''));
2713
+ return upperFirst$1.trimEnd(str, chars.toString().split(''));
2706
2714
  }
2707
2715
  }
2708
2716
  }
@@ -2717,24 +2725,28 @@ function trimStart(str, chars, guard) {
2717
2725
  }
2718
2726
  switch (typeof chars) {
2719
2727
  case 'string': {
2720
- return upperFirst.trimStart(str, chars.toString().split(''));
2728
+ return upperFirst$1.trimStart(str, chars.toString().split(''));
2721
2729
  }
2722
2730
  case 'object': {
2723
2731
  if (Array.isArray(chars)) {
2724
- return upperFirst.trimStart(str, chars.flatMap(x => x.toString().split('')));
2732
+ return upperFirst$1.trimStart(str, chars.flatMap(x => x.toString().split('')));
2725
2733
  }
2726
2734
  else {
2727
- return upperFirst.trimStart(str, chars.toString().split(''));
2735
+ return upperFirst$1.trimStart(str, chars.toString().split(''));
2728
2736
  }
2729
2737
  }
2730
2738
  }
2731
2739
  }
2732
2740
 
2733
2741
  function upperCase(str) {
2734
- return upperFirst.upperCase(normalizeForCase(str));
2742
+ return upperFirst$1.upperCase(normalizeForCase(str));
2743
+ }
2744
+
2745
+ function upperFirst(str) {
2746
+ return upperFirst$1.upperFirst(toString(str));
2735
2747
  }
2736
2748
 
2737
- function words(str, pattern = upperFirst.CASE_SPLIT_PATTERN) {
2749
+ function words(str, pattern = upperFirst$1.CASE_SPLIT_PATTERN) {
2738
2750
  const input = toString(str);
2739
2751
  const words = Array.from(input.match(pattern) ?? []);
2740
2752
  return words.filter(x => x !== '');
@@ -2954,14 +2966,11 @@ exports.isLength = isWeakSet$1.isLength;
2954
2966
  exports.isNotNil = isWeakSet$1.isNotNil;
2955
2967
  exports.isNull = isWeakSet$1.isNull;
2956
2968
  exports.isUndefined = isWeakSet$1.isUndefined;
2957
- exports.capitalize = upperFirst.capitalize;
2958
- exports.constantCase = upperFirst.constantCase;
2959
- exports.deburr = upperFirst.deburr;
2960
- exports.escapeRegExp = upperFirst.escapeRegExp;
2961
- exports.lowerFirst = upperFirst.lowerFirst;
2962
- exports.pascalCase = upperFirst.pascalCase;
2963
- exports.unescape = upperFirst.unescape;
2964
- exports.upperFirst = upperFirst.upperFirst;
2969
+ exports.capitalize = upperFirst$1.capitalize;
2970
+ exports.constantCase = upperFirst$1.constantCase;
2971
+ exports.escapeRegExp = upperFirst$1.escapeRegExp;
2972
+ exports.pascalCase = upperFirst$1.pascalCase;
2973
+ exports.unescape = upperFirst$1.unescape;
2965
2974
  exports.invariant = util_index.invariant;
2966
2975
  exports.add = add;
2967
2976
  exports.ary = ary;
@@ -2985,6 +2994,7 @@ exports.constant = constant;
2985
2994
  exports.curry = curry;
2986
2995
  exports.curryRight = curryRight;
2987
2996
  exports.debounce = debounce;
2997
+ exports.deburr = deburr;
2988
2998
  exports.defaultTo = defaultTo;
2989
2999
  exports.defaults = defaults;
2990
3000
  exports.defer = defer;
@@ -3064,6 +3074,7 @@ exports.keysIn = keysIn;
3064
3074
  exports.last = last;
3065
3075
  exports.lastIndexOf = lastIndexOf;
3066
3076
  exports.lowerCase = lowerCase;
3077
+ exports.lowerFirst = lowerFirst;
3067
3078
  exports.lt = lt;
3068
3079
  exports.lte = lte;
3069
3080
  exports.map = map;
@@ -3137,6 +3148,7 @@ exports.uniqBy = uniqBy;
3137
3148
  exports.unset = unset;
3138
3149
  exports.unzip = unzip;
3139
3150
  exports.upperCase = upperCase;
3151
+ exports.upperFirst = upperFirst;
3140
3152
  exports.without = without;
3141
3153
  exports.words = words;
3142
3154
  exports.zip = zip;
@@ -69,12 +69,10 @@ export { timeout } from '../promise/timeout.mjs';
69
69
  export { withTimeout } from '../promise/withTimeout.mjs';
70
70
  export { capitalize } from '../string/capitalize.mjs';
71
71
  export { constantCase } from '../string/constantCase.mjs';
72
- export { deburr } from '../string/deburr.mjs';
72
+ import '../string/deburr.mjs';
73
73
  export { escapeRegExp } from '../string/escapeRegExp.mjs';
74
- export { lowerFirst } from '../string/lowerFirst.mjs';
75
74
  export { pascalCase } from '../string/pascalCase.mjs';
76
75
  export { unescape } from '../string/unescape.mjs';
77
- export { upperFirst } from '../string/upperFirst.mjs';
78
76
  export { invariant } from '../util/invariant.mjs';
79
77
  export { castArray } from './array/castArray.mjs';
80
78
  export { chunk } from './array/chunk.mjs';
@@ -206,10 +204,12 @@ export { isWeakSet } from './predicate/isWeakSet.mjs';
206
204
  export { matches } from './predicate/matches.mjs';
207
205
  export { matchesProperty } from './predicate/matchesProperty.mjs';
208
206
  export { camelCase } from './string/camelCase.mjs';
207
+ export { deburr } from './string/deburr.mjs';
209
208
  export { endsWith } from './string/endsWith.mjs';
210
209
  export { escape } from './string/escape.mjs';
211
210
  export { kebabCase } from './string/kebabCase.mjs';
212
211
  export { lowerCase } from './string/lowerCase.mjs';
212
+ export { lowerFirst } from './string/lowerFirst.mjs';
213
213
  export { pad } from './string/pad.mjs';
214
214
  export { padEnd } from './string/padEnd.mjs';
215
215
  export { padStart } from './string/padStart.mjs';
@@ -225,6 +225,7 @@ export { trim } from './string/trim.mjs';
225
225
  export { trimEnd } from './string/trimEnd.mjs';
226
226
  export { trimStart } from './string/trimStart.mjs';
227
227
  export { upperCase } from './string/upperCase.mjs';
228
+ export { upperFirst } from './string/upperFirst.mjs';
228
229
  export { words } from './string/words.mjs';
229
230
  export { constant } from './util/constant.mjs';
230
231
  export { defaultTo } from './util/defaultTo.mjs';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Converts a string by replacing special characters and diacritical marks with their ASCII equivalents.
3
+ * For example, "Crème brûlée" becomes "Creme brulee".
4
+ *
5
+ * @param {string} str - The input string to be deburred.
6
+ * @returns {string} - The deburred string with special characters replaced by their ASCII equivalents.
7
+ *
8
+ * @example
9
+ * // Basic usage:
10
+ * deburr('Æthelred') // returns 'Aethelred'
11
+ *
12
+ * @example
13
+ * // Handling diacritical marks:
14
+ * deburr('München') // returns 'Munchen'
15
+ *
16
+ * @example
17
+ * // Special characters:
18
+ * deburr('Crème brûlée') // returns 'Creme brulee'
19
+ */
20
+ declare function deburr(str?: string): string;
21
+
22
+ export { deburr };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Converts a string by replacing special characters and diacritical marks with their ASCII equivalents.
3
+ * For example, "Crème brûlée" becomes "Creme brulee".
4
+ *
5
+ * @param {string} str - The input string to be deburred.
6
+ * @returns {string} - The deburred string with special characters replaced by their ASCII equivalents.
7
+ *
8
+ * @example
9
+ * // Basic usage:
10
+ * deburr('Æthelred') // returns 'Aethelred'
11
+ *
12
+ * @example
13
+ * // Handling diacritical marks:
14
+ * deburr('München') // returns 'Munchen'
15
+ *
16
+ * @example
17
+ * // Special characters:
18
+ * deburr('Crème brûlée') // returns 'Creme brulee'
19
+ */
20
+ declare function deburr(str?: string): string;
21
+
22
+ export { deburr };
@@ -0,0 +1,8 @@
1
+ import { deburr as deburr$1 } from '../../string/deburr.mjs';
2
+ import { toString } from '../util/toString.mjs';
3
+
4
+ function deburr(str) {
5
+ return deburr$1(toString(str));
6
+ }
7
+
8
+ export { deburr };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Converts the first character of string to lower case.
3
+ *
4
+ * @param {string} str - The string that is to be changed
5
+ * @returns {string} - The converted string.
6
+ *
7
+ * @example
8
+ * const convertedStr1 = lowerCase('fred') // returns 'fred'
9
+ * const convertedStr2 = lowerCase('Fred') // returns 'fred'
10
+ * const convertedStr3 = lowerCase('FRED') // returns 'fRED'
11
+ */
12
+ declare function lowerFirst(str?: string): string;
13
+
14
+ export { lowerFirst };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Converts the first character of string to lower case.
3
+ *
4
+ * @param {string} str - The string that is to be changed
5
+ * @returns {string} - The converted string.
6
+ *
7
+ * @example
8
+ * const convertedStr1 = lowerCase('fred') // returns 'fred'
9
+ * const convertedStr2 = lowerCase('Fred') // returns 'fred'
10
+ * const convertedStr3 = lowerCase('FRED') // returns 'fRED'
11
+ */
12
+ declare function lowerFirst(str?: string): string;
13
+
14
+ export { lowerFirst };
@@ -0,0 +1,8 @@
1
+ import { lowerFirst as lowerFirst$1 } from '../../string/lowerFirst.mjs';
2
+ import { toString } from '../util/toString.mjs';
3
+
4
+ function lowerFirst(str) {
5
+ return lowerFirst$1(toString(str));
6
+ }
7
+
8
+ export { lowerFirst };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Converts the first character of string to upper case.
3
+ *
4
+ * @param {string} str - The string that is to be changed
5
+ * @returns {string} - The converted string.
6
+ *
7
+ * @example
8
+ * const convertedStr1 = upperFirst('fred') // returns 'Fred'
9
+ * const convertedStr2 = upperFirst('Fred') // returns 'Fred'
10
+ * const convertedStr3 = upperFirst('FRED') // returns 'FRED'
11
+ */
12
+ declare function upperFirst(str?: string): string;
13
+
14
+ export { upperFirst };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Converts the first character of string to upper case.
3
+ *
4
+ * @param {string} str - The string that is to be changed
5
+ * @returns {string} - The converted string.
6
+ *
7
+ * @example
8
+ * const convertedStr1 = upperFirst('fred') // returns 'Fred'
9
+ * const convertedStr2 = upperFirst('Fred') // returns 'Fred'
10
+ * const convertedStr3 = upperFirst('FRED') // returns 'FRED'
11
+ */
12
+ declare function upperFirst(str?: string): string;
13
+
14
+ export { upperFirst };
@@ -0,0 +1,8 @@
1
+ import { upperFirst as upperFirst$1 } from '../../string/upperFirst.mjs';
2
+ import { toString } from '../util/toString.mjs';
3
+
4
+ function upperFirst(str) {
5
+ return upperFirst$1(toString(str));
6
+ }
7
+
8
+ export { upperFirst };
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.29.0-dev.940+ceb75130",
4
+ "version": "1.29.0-dev.942+f32d3759",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {