es-toolkit 1.18.0-dev.582 → 1.18.0-dev.584
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/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/index.d.mts +4 -4
- package/dist/compat/index.d.ts +4 -4
- package/dist/compat/index.js +20 -4
- package/dist/compat/index.mjs +4 -4
- package/dist/compat/predicate/isObject.d.mts +4 -4
- package/dist/compat/predicate/isObject.d.ts +4 -4
- package/dist/compat/string/kebabCase.d.mts +17 -0
- package/dist/compat/string/kebabCase.d.ts +17 -0
- package/dist/compat/string/kebabCase.mjs +9 -0
- package/dist/compat/string/lowerCase.d.mts +17 -0
- package/dist/compat/string/lowerCase.d.ts +17 -0
- package/dist/compat/string/lowerCase.mjs +8 -0
- package/dist/compat/string/snakeCase.d.mts +17 -0
- package/dist/compat/string/snakeCase.d.ts +17 -0
- package/dist/compat/string/snakeCase.mjs +8 -0
- package/dist/compat/string/startCase.d.mts +16 -0
- package/dist/compat/string/startCase.d.ts +16 -0
- package/dist/compat/string/startCase.mjs +8 -0
- package/dist/string/startCase.d.mts +1 -1
- package/dist/string/startCase.d.ts +1 -1
- package/package.json +1 -1
package/dist/compat/index.d.mts
CHANGED
|
@@ -88,11 +88,7 @@ export { isPrimitive } from '../predicate/isPrimitive.mjs';
|
|
|
88
88
|
export { delay } from '../promise/delay.mjs';
|
|
89
89
|
export { withTimeout } from '../promise/withTimeout.mjs';
|
|
90
90
|
export { timeout } from '../promise/timeout.mjs';
|
|
91
|
-
export { snakeCase } from '../string/snakeCase.mjs';
|
|
92
|
-
export { kebabCase } from '../string/kebabCase.mjs';
|
|
93
91
|
export { upperCase } from '../string/upperCase.mjs';
|
|
94
|
-
export { lowerCase } from '../string/lowerCase.mjs';
|
|
95
|
-
export { startCase } from '../string/startCase.mjs';
|
|
96
92
|
export { capitalize } from '../string/capitalize.mjs';
|
|
97
93
|
export { pascalCase } from '../string/pascalCase.mjs';
|
|
98
94
|
export { upperFirst } from '../string/upperFirst.mjs';
|
|
@@ -156,6 +152,10 @@ export { isWeakSet } from './predicate/isWeakSet.mjs';
|
|
|
156
152
|
export { conforms } from './predicate/conforms.mjs';
|
|
157
153
|
export { conformsTo } from './predicate/conformsTo.mjs';
|
|
158
154
|
export { camelCase } from './string/camelCase.mjs';
|
|
155
|
+
export { kebabCase } from './string/kebabCase.mjs';
|
|
156
|
+
export { snakeCase } from './string/snakeCase.mjs';
|
|
157
|
+
export { startCase } from './string/startCase.mjs';
|
|
158
|
+
export { lowerCase } from './string/lowerCase.mjs';
|
|
159
159
|
export { startsWith } from './string/startsWith.mjs';
|
|
160
160
|
export { endsWith } from './string/endsWith.mjs';
|
|
161
161
|
export { padStart } from './string/padStart.mjs';
|
package/dist/compat/index.d.ts
CHANGED
|
@@ -88,11 +88,7 @@ export { isPrimitive } from '../predicate/isPrimitive.js';
|
|
|
88
88
|
export { delay } from '../promise/delay.js';
|
|
89
89
|
export { withTimeout } from '../promise/withTimeout.js';
|
|
90
90
|
export { timeout } from '../promise/timeout.js';
|
|
91
|
-
export { snakeCase } from '../string/snakeCase.js';
|
|
92
|
-
export { kebabCase } from '../string/kebabCase.js';
|
|
93
91
|
export { upperCase } from '../string/upperCase.js';
|
|
94
|
-
export { lowerCase } from '../string/lowerCase.js';
|
|
95
|
-
export { startCase } from '../string/startCase.js';
|
|
96
92
|
export { capitalize } from '../string/capitalize.js';
|
|
97
93
|
export { pascalCase } from '../string/pascalCase.js';
|
|
98
94
|
export { upperFirst } from '../string/upperFirst.js';
|
|
@@ -156,6 +152,10 @@ export { isWeakSet } from './predicate/isWeakSet.js';
|
|
|
156
152
|
export { conforms } from './predicate/conforms.js';
|
|
157
153
|
export { conformsTo } from './predicate/conformsTo.js';
|
|
158
154
|
export { camelCase } from './string/camelCase.js';
|
|
155
|
+
export { kebabCase } from './string/kebabCase.js';
|
|
156
|
+
export { snakeCase } from './string/snakeCase.js';
|
|
157
|
+
export { startCase } from './string/startCase.js';
|
|
158
|
+
export { lowerCase } from './string/lowerCase.js';
|
|
159
159
|
export { startsWith } from './string/startsWith.js';
|
|
160
160
|
export { endsWith } from './string/endsWith.js';
|
|
161
161
|
export { padStart } from './string/padStart.js';
|
package/dist/compat/index.js
CHANGED
|
@@ -1040,6 +1040,22 @@ function camelCase(str) {
|
|
|
1040
1040
|
return string_index.camelCase(normalizeForCase(str));
|
|
1041
1041
|
}
|
|
1042
1042
|
|
|
1043
|
+
function kebabCase(str) {
|
|
1044
|
+
return string_index.kebabCase(normalizeForCase(str));
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
function snakeCase(str) {
|
|
1048
|
+
return string_index.snakeCase(normalizeForCase(str));
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
function startCase(str) {
|
|
1052
|
+
return string_index.startCase(normalizeForCase(str));
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
function lowerCase(str) {
|
|
1056
|
+
return string_index.lowerCase(normalizeForCase(str));
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1043
1059
|
function startsWith(str, target, position = 0) {
|
|
1044
1060
|
return str.startsWith(target, position);
|
|
1045
1061
|
}
|
|
@@ -1283,13 +1299,9 @@ exports.capitalize = string_index.capitalize;
|
|
|
1283
1299
|
exports.deburr = string_index.deburr;
|
|
1284
1300
|
exports.escape = string_index.escape;
|
|
1285
1301
|
exports.escapeRegExp = string_index.escapeRegExp;
|
|
1286
|
-
exports.kebabCase = string_index.kebabCase;
|
|
1287
|
-
exports.lowerCase = string_index.lowerCase;
|
|
1288
1302
|
exports.lowerFirst = string_index.lowerFirst;
|
|
1289
1303
|
exports.pad = string_index.pad;
|
|
1290
1304
|
exports.pascalCase = string_index.pascalCase;
|
|
1291
|
-
exports.snakeCase = string_index.snakeCase;
|
|
1292
|
-
exports.startCase = string_index.startCase;
|
|
1293
1305
|
exports.unescape = string_index.unescape;
|
|
1294
1306
|
exports.upperCase = string_index.upperCase;
|
|
1295
1307
|
exports.upperFirst = string_index.upperFirst;
|
|
@@ -1332,6 +1344,8 @@ exports.isTypedArray = isTypedArray;
|
|
|
1332
1344
|
exports.isWeakMap = isWeakMap;
|
|
1333
1345
|
exports.isWeakSet = isWeakSet;
|
|
1334
1346
|
exports.join = join;
|
|
1347
|
+
exports.kebabCase = kebabCase;
|
|
1348
|
+
exports.lowerCase = lowerCase;
|
|
1335
1349
|
exports.mapKeys = mapKeys;
|
|
1336
1350
|
exports.mapValues = mapValues;
|
|
1337
1351
|
exports.matches = matches;
|
|
@@ -1352,9 +1366,11 @@ exports.rest = rest;
|
|
|
1352
1366
|
exports.round = round;
|
|
1353
1367
|
exports.set = set;
|
|
1354
1368
|
exports.size = size;
|
|
1369
|
+
exports.snakeCase = snakeCase;
|
|
1355
1370
|
exports.some = some;
|
|
1356
1371
|
exports.sortBy = sortBy;
|
|
1357
1372
|
exports.spread = spread;
|
|
1373
|
+
exports.startCase = startCase;
|
|
1358
1374
|
exports.startsWith = startsWith;
|
|
1359
1375
|
exports.trim = trim;
|
|
1360
1376
|
exports.trimEnd = trimEnd;
|
package/dist/compat/index.mjs
CHANGED
|
@@ -90,11 +90,7 @@ export { delay } from '../promise/delay.mjs';
|
|
|
90
90
|
export { withTimeout } from '../promise/withTimeout.mjs';
|
|
91
91
|
export { timeout } from '../promise/timeout.mjs';
|
|
92
92
|
export { capitalize } from '../string/capitalize.mjs';
|
|
93
|
-
export { snakeCase } from '../string/snakeCase.mjs';
|
|
94
|
-
export { kebabCase } from '../string/kebabCase.mjs';
|
|
95
93
|
export { upperCase } from '../string/upperCase.mjs';
|
|
96
|
-
export { lowerCase } from '../string/lowerCase.mjs';
|
|
97
|
-
export { startCase } from '../string/startCase.mjs';
|
|
98
94
|
export { pascalCase } from '../string/pascalCase.mjs';
|
|
99
95
|
export { upperFirst } from '../string/upperFirst.mjs';
|
|
100
96
|
export { lowerFirst } from '../string/lowerFirst.mjs';
|
|
@@ -156,6 +152,10 @@ export { isWeakSet } from './predicate/isWeakSet.mjs';
|
|
|
156
152
|
export { conforms } from './predicate/conforms.mjs';
|
|
157
153
|
export { conformsTo } from './predicate/conformsTo.mjs';
|
|
158
154
|
export { camelCase } from './string/camelCase.mjs';
|
|
155
|
+
export { kebabCase } from './string/kebabCase.mjs';
|
|
156
|
+
export { snakeCase } from './string/snakeCase.mjs';
|
|
157
|
+
export { startCase } from './string/startCase.mjs';
|
|
158
|
+
export { lowerCase } from './string/lowerCase.mjs';
|
|
159
159
|
export { startsWith } from './string/startsWith.mjs';
|
|
160
160
|
export { endsWith } from './string/endsWith.mjs';
|
|
161
161
|
export { padStart } from './string/padStart.mjs';
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
* const value3 = () => {};
|
|
17
17
|
* const value4 = null;
|
|
18
18
|
*
|
|
19
|
-
* console.log(
|
|
20
|
-
* console.log(
|
|
21
|
-
* console.log(
|
|
22
|
-
* console.log(
|
|
19
|
+
* console.log(isObject(value1)); // true
|
|
20
|
+
* console.log(isObject(value2)); // true
|
|
21
|
+
* console.log(isObject(value3)); // true
|
|
22
|
+
* console.log(isObject(value4)); // false
|
|
23
23
|
*/
|
|
24
24
|
declare function isObject(value: unknown): value is object;
|
|
25
25
|
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
* const value3 = () => {};
|
|
17
17
|
* const value4 = null;
|
|
18
18
|
*
|
|
19
|
-
* console.log(
|
|
20
|
-
* console.log(
|
|
21
|
-
* console.log(
|
|
22
|
-
* console.log(
|
|
19
|
+
* console.log(isObject(value1)); // true
|
|
20
|
+
* console.log(isObject(value2)); // true
|
|
21
|
+
* console.log(isObject(value3)); // true
|
|
22
|
+
* console.log(isObject(value4)); // false
|
|
23
23
|
*/
|
|
24
24
|
declare function isObject(value: unknown): value is object;
|
|
25
25
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string to kebab case.
|
|
3
|
+
*
|
|
4
|
+
* Kebab case is the naming convention in which each word is written in lowercase and separated by a dash (-) character.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} str - The string that is to be changed to kebab case.
|
|
7
|
+
* @returns {string} - The converted string to kebab case.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const convertedStr1 = kebabCase('camelCase') // returns 'camel-case'
|
|
11
|
+
* const convertedStr2 = kebabCase('some whitespace') // returns 'some-whitespace'
|
|
12
|
+
* const convertedStr3 = kebabCase('hyphen-text') // returns 'hyphen-text'
|
|
13
|
+
* const convertedStr4 = kebabCase('HTTPRequest') // returns 'http-request'
|
|
14
|
+
*/
|
|
15
|
+
declare function kebabCase(str: string | object): string;
|
|
16
|
+
|
|
17
|
+
export { kebabCase };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string to kebab case.
|
|
3
|
+
*
|
|
4
|
+
* Kebab case is the naming convention in which each word is written in lowercase and separated by a dash (-) character.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} str - The string that is to be changed to kebab case.
|
|
7
|
+
* @returns {string} - The converted string to kebab case.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const convertedStr1 = kebabCase('camelCase') // returns 'camel-case'
|
|
11
|
+
* const convertedStr2 = kebabCase('some whitespace') // returns 'some-whitespace'
|
|
12
|
+
* const convertedStr3 = kebabCase('hyphen-text') // returns 'hyphen-text'
|
|
13
|
+
* const convertedStr4 = kebabCase('HTTPRequest') // returns 'http-request'
|
|
14
|
+
*/
|
|
15
|
+
declare function kebabCase(str: string | object): string;
|
|
16
|
+
|
|
17
|
+
export { kebabCase };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { kebabCase as kebabCase$1 } from '../../string/kebabCase.mjs';
|
|
2
|
+
import '../../string/deburr.mjs';
|
|
3
|
+
import { normalizeForCase } from '../_internal/normalizeForCase.mjs';
|
|
4
|
+
|
|
5
|
+
function kebabCase(str) {
|
|
6
|
+
return kebabCase$1(normalizeForCase(str));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { kebabCase };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string to lower case.
|
|
3
|
+
*
|
|
4
|
+
* Lower case is the naming convention in which each word is written in lowercase and separated by an space ( ) character.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} str - The string that is to be changed to lower case.
|
|
7
|
+
* @returns {string} - The converted string to lower case.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const convertedStr1 = lowerCase('camelCase') // returns 'camel case'
|
|
11
|
+
* const convertedStr2 = lowerCase('some whitespace') // returns 'some whitespace'
|
|
12
|
+
* const convertedStr3 = lowerCase('hyphen-text') // returns 'hyphen text'
|
|
13
|
+
* const convertedStr4 = lowerCase('HTTPRequest') // returns 'http request'
|
|
14
|
+
*/
|
|
15
|
+
declare function lowerCase(str: string | object): string;
|
|
16
|
+
|
|
17
|
+
export { lowerCase };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string to lower case.
|
|
3
|
+
*
|
|
4
|
+
* Lower case is the naming convention in which each word is written in lowercase and separated by an space ( ) character.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} str - The string that is to be changed to lower case.
|
|
7
|
+
* @returns {string} - The converted string to lower case.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const convertedStr1 = lowerCase('camelCase') // returns 'camel case'
|
|
11
|
+
* const convertedStr2 = lowerCase('some whitespace') // returns 'some whitespace'
|
|
12
|
+
* const convertedStr3 = lowerCase('hyphen-text') // returns 'hyphen text'
|
|
13
|
+
* const convertedStr4 = lowerCase('HTTPRequest') // returns 'http request'
|
|
14
|
+
*/
|
|
15
|
+
declare function lowerCase(str: string | object): string;
|
|
16
|
+
|
|
17
|
+
export { lowerCase };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string to snake case.
|
|
3
|
+
*
|
|
4
|
+
* Snake case is the naming convention in which each word is written in lowercase and separated by an underscore (_) character.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} str - The string that is to be changed to snake case.
|
|
7
|
+
* @returns {string} - The converted string to snake case.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const convertedStr1 = snakeCase('camelCase') // returns 'camel_case'
|
|
11
|
+
* const convertedStr2 = snakeCase('some whitespace') // returns 'some_whitespace'
|
|
12
|
+
* const convertedStr3 = snakeCase('hyphen-text') // returns 'hyphen_text'
|
|
13
|
+
* const convertedStr4 = snakeCase('HTTPRequest') // returns 'http_request'
|
|
14
|
+
*/
|
|
15
|
+
declare function snakeCase(str: string | object): string;
|
|
16
|
+
|
|
17
|
+
export { snakeCase };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string to snake case.
|
|
3
|
+
*
|
|
4
|
+
* Snake case is the naming convention in which each word is written in lowercase and separated by an underscore (_) character.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} str - The string that is to be changed to snake case.
|
|
7
|
+
* @returns {string} - The converted string to snake case.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const convertedStr1 = snakeCase('camelCase') // returns 'camel_case'
|
|
11
|
+
* const convertedStr2 = snakeCase('some whitespace') // returns 'some_whitespace'
|
|
12
|
+
* const convertedStr3 = snakeCase('hyphen-text') // returns 'hyphen_text'
|
|
13
|
+
* const convertedStr4 = snakeCase('HTTPRequest') // returns 'http_request'
|
|
14
|
+
*/
|
|
15
|
+
declare function snakeCase(str: string | object): string;
|
|
16
|
+
|
|
17
|
+
export { snakeCase };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts the first character of each word in a string to uppercase and the remaining characters to lowercase.
|
|
3
|
+
*
|
|
4
|
+
* Start case is the naming convention in which each word is written with an initial capital letter.
|
|
5
|
+
* @param {string} str - The string to convert.
|
|
6
|
+
* @returns {string} The converted string.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const result1 = startCase('hello world'); // result will be 'Hello World'
|
|
10
|
+
* const result2 = startCase('HELLO WORLD'); // result will be 'HELLO WORLD'
|
|
11
|
+
* const result3 = startCase('hello-world'); // result will be 'Hello World'
|
|
12
|
+
* const result4 = startCase('hello_world'); // result will be 'Hello World'
|
|
13
|
+
*/
|
|
14
|
+
declare function startCase(str: string | object): string;
|
|
15
|
+
|
|
16
|
+
export { startCase };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts the first character of each word in a string to uppercase and the remaining characters to lowercase.
|
|
3
|
+
*
|
|
4
|
+
* Start case is the naming convention in which each word is written with an initial capital letter.
|
|
5
|
+
* @param {string} str - The string to convert.
|
|
6
|
+
* @returns {string} The converted string.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const result1 = startCase('hello world'); // result will be 'Hello World'
|
|
10
|
+
* const result2 = startCase('HELLO WORLD'); // result will be 'HELLO WORLD'
|
|
11
|
+
* const result3 = startCase('hello-world'); // result will be 'Hello World'
|
|
12
|
+
* const result4 = startCase('hello_world'); // result will be 'Hello World'
|
|
13
|
+
*/
|
|
14
|
+
declare function startCase(str: string | object): string;
|
|
15
|
+
|
|
16
|
+
export { startCase };
|
|
@@ -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 '
|
|
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 '
|
|
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
|
*/
|
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.18.0-dev.
|
|
4
|
+
"version": "1.18.0-dev.584+31769810",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|