es-toolkit 1.17.0-dev.559 → 1.17.0-dev.560

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.
@@ -0,0 +1,9 @@
1
+ function normalizeForCase(str) {
2
+ if (typeof str === 'object') {
3
+ str = str.toString();
4
+ }
5
+ str = str.replace(/['\u2019]/g, '');
6
+ return str;
7
+ }
8
+
9
+ export { normalizeForCase };
@@ -91,7 +91,6 @@ export { isPrimitive } from '../predicate/isPrimitive.mjs';
91
91
  export { delay } from '../promise/delay.mjs';
92
92
  export { withTimeout } from '../promise/withTimeout.mjs';
93
93
  export { timeout } from '../promise/timeout.mjs';
94
- export { camelCase } from '../string/camelCase.mjs';
95
94
  export { snakeCase } from '../string/snakeCase.mjs';
96
95
  export { kebabCase } from '../string/kebabCase.mjs';
97
96
  export { lowerCase } from '../string/lowerCase.mjs';
@@ -154,6 +153,7 @@ export { isWeakMap } from './predicate/isWeakMap.mjs';
154
153
  export { isWeakSet } from './predicate/isWeakSet.mjs';
155
154
  export { conforms } from './predicate/conforms.mjs';
156
155
  export { conformsTo } from './predicate/conformsTo.mjs';
156
+ export { camelCase } from './string/camelCase.mjs';
157
157
  export { startsWith } from './string/startsWith.mjs';
158
158
  export { endsWith } from './string/endsWith.mjs';
159
159
  export { padStart } from './string/padStart.mjs';
@@ -91,7 +91,6 @@ export { isPrimitive } from '../predicate/isPrimitive.js';
91
91
  export { delay } from '../promise/delay.js';
92
92
  export { withTimeout } from '../promise/withTimeout.js';
93
93
  export { timeout } from '../promise/timeout.js';
94
- export { camelCase } from '../string/camelCase.js';
95
94
  export { snakeCase } from '../string/snakeCase.js';
96
95
  export { kebabCase } from '../string/kebabCase.js';
97
96
  export { lowerCase } from '../string/lowerCase.js';
@@ -154,6 +153,7 @@ export { isWeakMap } from './predicate/isWeakMap.js';
154
153
  export { isWeakSet } from './predicate/isWeakSet.js';
155
154
  export { conforms } from './predicate/conforms.js';
156
155
  export { conformsTo } from './predicate/conformsTo.js';
156
+ export { camelCase } from './string/camelCase.js';
157
157
  export { startsWith } from './string/startsWith.js';
158
158
  export { endsWith } from './string/endsWith.js';
159
159
  export { padStart } from './string/padStart.js';
@@ -955,6 +955,18 @@ function conforms(source) {
955
955
  };
956
956
  }
957
957
 
958
+ function normalizeForCase(str) {
959
+ if (typeof str === 'object') {
960
+ str = str.toString();
961
+ }
962
+ str = str.replace(/['\u2019]/g, '');
963
+ return str;
964
+ }
965
+
966
+ function camelCase(str) {
967
+ return string_index.camelCase(normalizeForCase(str));
968
+ }
969
+
958
970
  function startsWith(str, target, position = 0) {
959
971
  return str.startsWith(target, position);
960
972
  }
@@ -1094,7 +1106,6 @@ exports.isNotNil = isWeakSet$1.isNotNil;
1094
1106
  exports.isNull = isWeakSet$1.isNull;
1095
1107
  exports.isUndefined = isWeakSet$1.isUndefined;
1096
1108
  exports.isPrimitive = isTypedArray$1.isPrimitive;
1097
- exports.camelCase = string_index.camelCase;
1098
1109
  exports.capitalize = string_index.capitalize;
1099
1110
  exports.deburr = string_index.deburr;
1100
1111
  exports.escape = string_index.escape;
@@ -1112,6 +1123,7 @@ exports.ary = ary;
1112
1123
  exports.attempt = attempt;
1113
1124
  exports.bind = bind;
1114
1125
  exports.bindKey = bindKey;
1126
+ exports.camelCase = camelCase;
1115
1127
  exports.castArray = castArray;
1116
1128
  exports.chunk = chunk;
1117
1129
  exports.concat = concat;
@@ -92,12 +92,11 @@ export { isPrimitive } from '../predicate/isPrimitive.mjs';
92
92
  export { delay } from '../promise/delay.mjs';
93
93
  export { withTimeout } from '../promise/withTimeout.mjs';
94
94
  export { timeout } from '../promise/timeout.mjs';
95
- export { camelCase } from '../string/camelCase.mjs';
95
+ export { capitalize } from '../string/capitalize.mjs';
96
96
  export { snakeCase } from '../string/snakeCase.mjs';
97
97
  export { kebabCase } from '../string/kebabCase.mjs';
98
98
  export { lowerCase } from '../string/lowerCase.mjs';
99
99
  export { startCase } from '../string/startCase.mjs';
100
- export { capitalize } from '../string/capitalize.mjs';
101
100
  export { pascalCase } from '../string/pascalCase.mjs';
102
101
  export { upperFirst } from '../string/upperFirst.mjs';
103
102
  export { lowerFirst } from '../string/lowerFirst.mjs';
@@ -154,6 +153,7 @@ export { isWeakMap } from './predicate/isWeakMap.mjs';
154
153
  export { isWeakSet } from './predicate/isWeakSet.mjs';
155
154
  export { conforms } from './predicate/conforms.mjs';
156
155
  export { conformsTo } from './predicate/conformsTo.mjs';
156
+ export { camelCase } from './string/camelCase.mjs';
157
157
  export { startsWith } from './string/startsWith.mjs';
158
158
  export { endsWith } from './string/endsWith.mjs';
159
159
  export { padStart } from './string/padStart.mjs';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Converts a string to camel case.
3
+ *
4
+ * Camel case is the naming convention in which the first word is written in lowercase and
5
+ * each subsequent word begins with a capital letter, concatenated without any separator characters.
6
+ *
7
+ * @param {string | object} str - The string that is to be changed to camel case.
8
+ * @returns {string} - The converted string to camel case.
9
+ *
10
+ * @example
11
+ * const convertedStr1 = camelCase('camelCase') // returns 'camelCase'
12
+ * const convertedStr2 = camelCase('some whitespace') // returns 'someWhitespace'
13
+ * const convertedStr3 = camelCase('hyphen-text') // returns 'hyphenText'
14
+ * const convertedStr4 = camelCase('HTTPRequest') // returns 'httpRequest'
15
+ */
16
+ declare function camelCase(str: string | object): string;
17
+
18
+ export { camelCase };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Converts a string to camel case.
3
+ *
4
+ * Camel case is the naming convention in which the first word is written in lowercase and
5
+ * each subsequent word begins with a capital letter, concatenated without any separator characters.
6
+ *
7
+ * @param {string | object} str - The string that is to be changed to camel case.
8
+ * @returns {string} - The converted string to camel case.
9
+ *
10
+ * @example
11
+ * const convertedStr1 = camelCase('camelCase') // returns 'camelCase'
12
+ * const convertedStr2 = camelCase('some whitespace') // returns 'someWhitespace'
13
+ * const convertedStr3 = camelCase('hyphen-text') // returns 'hyphenText'
14
+ * const convertedStr4 = camelCase('HTTPRequest') // returns 'httpRequest'
15
+ */
16
+ declare function camelCase(str: string | object): string;
17
+
18
+ export { camelCase };
@@ -0,0 +1,8 @@
1
+ import { camelCase as camelCase$1 } from '../../string/camelCase.mjs';
2
+ import { normalizeForCase } from '../_internal/normalizeForCase.mjs';
3
+
4
+ function camelCase(str) {
5
+ return camelCase$1(normalizeForCase(str));
6
+ }
7
+
8
+ export { camelCase };
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.17.0-dev.559+1d15d741",
4
+ "version": "1.17.0-dev.560+9c721833",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {