es-toolkit 1.17.0-dev.535 → 1.17.0-dev.537
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/_chunk/{initial-CMlK06.js → initial-crEecP.js} +5 -5
- package/dist/_chunk/{randomInt-DJFj2K.js → randomInt-CF7bZK.js} +1 -1
- package/dist/_chunk/{rest-CXB7TJ.js → rest-CXt9w3.js} +2 -2
- package/dist/array/index.js +1 -1
- package/dist/array/join.mjs +1 -1
- package/dist/array/zip.mjs +1 -1
- package/dist/array/zipWith.mjs +2 -2
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/array/find.mjs +3 -3
- package/dist/compat/array/findIndex.mjs +3 -3
- package/dist/compat/function/attempt.d.mts +33 -0
- package/dist/compat/function/attempt.d.ts +33 -0
- package/dist/compat/function/attempt.mjs +10 -0
- package/dist/compat/index.d.mts +1 -0
- package/dist/compat/index.d.ts +1 -0
- package/dist/compat/index.js +40 -39
- package/dist/compat/index.mjs +1 -0
- package/dist/compat/object/fromPairs.d.mts +2 -4
- package/dist/compat/object/fromPairs.d.ts +2 -4
- package/dist/compat/object/get.mjs +1 -1
- package/dist/compat/object/has.mjs +2 -3
- package/dist/compat/object/mapKeys.mjs +6 -7
- package/dist/compat/object/mapValues.mjs +6 -7
- package/dist/compat/object/mergeWith.mjs +3 -5
- package/dist/compat/object/set.mjs +1 -5
- package/dist/compat/predicate/isMatch.mjs +2 -2
- package/dist/function/before.mjs +1 -1
- package/dist/function/debounce.mjs +1 -1
- package/dist/function/index.js +1 -1
- package/dist/index.js +3 -3
- package/dist/math/index.js +1 -1
- package/dist/math/random.mjs +1 -1
- package/dist/predicate/index.js +1 -1
- package/dist/predicate/isSymbol.mjs +1 -1
- package/dist/string/capitalize.mjs +1 -2
- package/dist/string/escapeRegExp.mjs +1 -1
- package/dist/string/index.js +6 -7
- package/dist/string/kebabCase.mjs +1 -1
- package/dist/string/lowerCase.mjs +1 -1
- package/dist/string/pascalCase.mjs +1 -1
- package/dist/string/snakeCase.mjs +1 -1
- package/package.json +1 -1
package/dist/string/index.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
function capitalize(str) {
|
|
6
|
-
return (str.charAt(0).toUpperCase() +
|
|
7
|
-
str.slice(1).toLowerCase());
|
|
6
|
+
return (str.charAt(0).toUpperCase() + str.slice(1).toLowerCase());
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
const CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;
|
|
@@ -23,17 +22,17 @@ function camelCase(str) {
|
|
|
23
22
|
|
|
24
23
|
function snakeCase(str) {
|
|
25
24
|
const words = getWords(str);
|
|
26
|
-
return words.map(
|
|
25
|
+
return words.map(word => word.toLowerCase()).join('_');
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
function kebabCase(str) {
|
|
30
29
|
const words = getWords(str);
|
|
31
|
-
return words.map(
|
|
30
|
+
return words.map(word => word.toLowerCase()).join('-');
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
function lowerCase(str) {
|
|
35
34
|
const words = getWords(str);
|
|
36
|
-
return words.map(
|
|
35
|
+
return words.map(word => word.toLowerCase()).join(' ');
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
function startCase(str) {
|
|
@@ -55,7 +54,7 @@ function startCase(str) {
|
|
|
55
54
|
|
|
56
55
|
function pascalCase(str) {
|
|
57
56
|
const words = getWords(str);
|
|
58
|
-
return words.map(
|
|
57
|
+
return words.map(word => capitalize(word)).join('');
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
function upperFirst(str) {
|
|
@@ -122,7 +121,7 @@ function escape(str) {
|
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
function escapeRegExp(str) {
|
|
125
|
-
return str.replace(/[\\^$.*+?()[\]{}|]/g,
|
|
124
|
+
return str.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&');
|
|
126
125
|
}
|
|
127
126
|
|
|
128
127
|
const htmlUnescapes = {
|
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.
|
|
4
|
+
"version": "1.17.0-dev.537+c37e1c5b",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|