es-toolkit 1.9.0-dev.180 → 1.9.0-dev.182
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/array/index.mjs +28 -28
- package/dist/{chunk-VRFIBW4H.mjs → chunk-47QP3LTV.mjs} +2 -2
- package/dist/chunk-HXGADE4C.mjs +1 -0
- package/dist/{chunk-T5URDZEQ.mjs → chunk-IJJCMZIV.mjs} +2 -2
- package/dist/{chunk-T5URDZEQ.mjs.map → chunk-IJJCMZIV.mjs.map} +1 -1
- package/dist/chunk-KPFMOZXV.mjs +14 -0
- package/dist/chunk-KPFMOZXV.mjs.map +1 -0
- package/dist/chunk-XWJ7NQF4.mjs +14 -0
- package/dist/chunk-XWJ7NQF4.mjs.map +1 -0
- package/dist/constants/caseSplitPattern.js +1 -1
- package/dist/constants/caseSplitPattern.js.map +1 -1
- package/dist/constants/caseSplitPattern.mjs +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/index.mjs +1 -1
- package/dist/function/index.mjs +6 -6
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -40
- package/dist/string/index.d.mts +2 -0
- package/dist/string/index.d.ts +2 -0
- package/dist/string/index.js +17 -1
- package/dist/string/index.js.map +1 -1
- package/dist/string/index.mjs +11 -3
- package/dist/string/kebabCase.d.mts +17 -0
- package/dist/string/kebabCase.d.ts +17 -0
- package/dist/string/kebabCase.js +39 -0
- package/dist/string/kebabCase.js.map +1 -0
- package/dist/string/kebabCase.mjs +10 -0
- package/dist/string/kebabCase.mjs.map +1 -0
- package/dist/string/lowerCase.d.mts +17 -0
- package/dist/string/lowerCase.d.ts +17 -0
- package/dist/string/lowerCase.js +39 -0
- package/dist/string/lowerCase.js.map +1 -0
- package/dist/string/lowerCase.mjs +10 -0
- package/dist/string/lowerCase.mjs.map +1 -0
- package/dist/string/snakeCase.js +1 -1
- package/dist/string/snakeCase.js.map +1 -1
- package/dist/string/snakeCase.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-MPBVTIU3.mjs +0 -1
- /package/dist/{chunk-VRFIBW4H.mjs.map → chunk-47QP3LTV.mjs.map} +0 -0
- /package/dist/{chunk-MPBVTIU3.mjs.map → chunk-HXGADE4C.mjs.map} +0 -0
package/dist/array/index.mjs
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import "../chunk-OJSIDS6H.mjs";
|
|
2
|
+
import {
|
|
3
|
+
xorWith
|
|
4
|
+
} from "../chunk-QRSJBBFY.mjs";
|
|
5
|
+
import {
|
|
6
|
+
zip
|
|
7
|
+
} from "../chunk-IDCUZVJL.mjs";
|
|
2
8
|
import {
|
|
3
9
|
zipObject
|
|
4
10
|
} from "../chunk-6GWEY5EL.mjs";
|
|
5
11
|
import {
|
|
6
12
|
zipWith
|
|
7
13
|
} from "../chunk-4KYXHZ4R.mjs";
|
|
14
|
+
import {
|
|
15
|
+
uniqBy
|
|
16
|
+
} from "../chunk-OXAZEEGP.mjs";
|
|
8
17
|
import {
|
|
9
18
|
unzip
|
|
10
19
|
} from "../chunk-UYZKMBDO.mjs";
|
|
@@ -21,11 +30,11 @@ import {
|
|
|
21
30
|
xorBy
|
|
22
31
|
} from "../chunk-Q47NGNXT.mjs";
|
|
23
32
|
import {
|
|
24
|
-
|
|
25
|
-
} from "../chunk-
|
|
33
|
+
take
|
|
34
|
+
} from "../chunk-ME352XO7.mjs";
|
|
26
35
|
import {
|
|
27
|
-
|
|
28
|
-
} from "../chunk-
|
|
36
|
+
takeRight
|
|
37
|
+
} from "../chunk-IQLKIDXF.mjs";
|
|
29
38
|
import {
|
|
30
39
|
takeRightWhile
|
|
31
40
|
} from "../chunk-NTLX2MPV.mjs";
|
|
@@ -38,6 +47,9 @@ import {
|
|
|
38
47
|
import {
|
|
39
48
|
union
|
|
40
49
|
} from "../chunk-R6QA7PLZ.mjs";
|
|
50
|
+
import {
|
|
51
|
+
uniq
|
|
52
|
+
} from "../chunk-DVK2N4KC.mjs";
|
|
41
53
|
import {
|
|
42
54
|
unionBy
|
|
43
55
|
} from "../chunk-NFS7RWWE.mjs";
|
|
@@ -48,11 +60,11 @@ import {
|
|
|
48
60
|
uniqWith
|
|
49
61
|
} from "../chunk-237HGSZS.mjs";
|
|
50
62
|
import {
|
|
51
|
-
|
|
52
|
-
} from "../chunk-
|
|
63
|
+
maxBy
|
|
64
|
+
} from "../chunk-OOKNBU4V.mjs";
|
|
53
65
|
import {
|
|
54
|
-
|
|
55
|
-
} from "../chunk-
|
|
66
|
+
minBy
|
|
67
|
+
} from "../chunk-IJD7FE2Z.mjs";
|
|
56
68
|
import {
|
|
57
69
|
orderBy
|
|
58
70
|
} from "../chunk-7B7W36UP.mjs";
|
|
@@ -74,11 +86,11 @@ import {
|
|
|
74
86
|
tail
|
|
75
87
|
} from "../chunk-OF6NM4G7.mjs";
|
|
76
88
|
import {
|
|
77
|
-
|
|
78
|
-
} from "../chunk-
|
|
89
|
+
groupBy
|
|
90
|
+
} from "../chunk-E6E4RZLN.mjs";
|
|
79
91
|
import {
|
|
80
|
-
|
|
81
|
-
} from "../chunk-
|
|
92
|
+
head
|
|
93
|
+
} from "../chunk-HM2JT2RX.mjs";
|
|
82
94
|
import {
|
|
83
95
|
intersection
|
|
84
96
|
} from "../chunk-FVVSE2F2.mjs";
|
|
@@ -95,11 +107,11 @@ import {
|
|
|
95
107
|
last
|
|
96
108
|
} from "../chunk-KPBQ7OUY.mjs";
|
|
97
109
|
import {
|
|
98
|
-
|
|
99
|
-
} from "../chunk-
|
|
110
|
+
drop
|
|
111
|
+
} from "../chunk-S3CORED5.mjs";
|
|
100
112
|
import {
|
|
101
|
-
|
|
102
|
-
} from "../chunk-
|
|
113
|
+
dropRight
|
|
114
|
+
} from "../chunk-JEKUA56R.mjs";
|
|
103
115
|
import {
|
|
104
116
|
dropRightWhile
|
|
105
117
|
} from "../chunk-JE6JKZU3.mjs";
|
|
@@ -118,12 +130,6 @@ import {
|
|
|
118
130
|
import {
|
|
119
131
|
forEachRight
|
|
120
132
|
} from "../chunk-IEA53J7P.mjs";
|
|
121
|
-
import {
|
|
122
|
-
groupBy
|
|
123
|
-
} from "../chunk-E6E4RZLN.mjs";
|
|
124
|
-
import {
|
|
125
|
-
head
|
|
126
|
-
} from "../chunk-HM2JT2RX.mjs";
|
|
127
133
|
import {
|
|
128
134
|
chunk
|
|
129
135
|
} from "../chunk-E6C5EZQA.mjs";
|
|
@@ -142,12 +148,6 @@ import {
|
|
|
142
148
|
import {
|
|
143
149
|
differenceWith
|
|
144
150
|
} from "../chunk-6NVQAHXP.mjs";
|
|
145
|
-
import {
|
|
146
|
-
drop
|
|
147
|
-
} from "../chunk-S3CORED5.mjs";
|
|
148
|
-
import {
|
|
149
|
-
dropRight
|
|
150
|
-
} from "../chunk-JEKUA56R.mjs";
|
|
151
151
|
import "../chunk-2MM5EJJX.mjs";
|
|
152
152
|
export {
|
|
153
153
|
chunk,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CASE_SPLIT_PATTERN
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IJJCMZIV.mjs";
|
|
4
4
|
|
|
5
5
|
// src/string/snakeCase.ts
|
|
6
6
|
var snakeCase = (str) => {
|
|
@@ -11,4 +11,4 @@ var snakeCase = (str) => {
|
|
|
11
11
|
export {
|
|
12
12
|
snakeCase
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-47QP3LTV.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-HXGADE4C.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/constants/caseSplitPattern.ts
|
|
2
|
-
var CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]
|
|
2
|
+
var CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]+|[0-9]+/g;
|
|
3
3
|
|
|
4
4
|
export {
|
|
5
5
|
CASE_SPLIT_PATTERN
|
|
6
6
|
};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-IJJCMZIV.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constants/caseSplitPattern.ts"],"sourcesContent":["/**\n * Regular expression pattern to split strings into words for various case conversions\n *\n * This pattern matchs sequences of characters in a string, considering the following case:\n * - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n * - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n * - Single uppercase letters\n * - Sequences of digis\n *\n * The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n * a consistent format like snake case.\n *\n * @example\n * const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n * // matchs: ['camel', 'Case', 'HTTP', 'Request']\n */\n\nexport const CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]
|
|
1
|
+
{"version":3,"sources":["../src/constants/caseSplitPattern.ts"],"sourcesContent":["/**\n * Regular expression pattern to split strings into words for various case conversions\n *\n * This pattern matchs sequences of characters in a string, considering the following case:\n * - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n * - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n * - Single uppercase letters\n * - Sequences of digis\n *\n * The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n * a consistent format like snake case.\n *\n * @example\n * const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n * // matchs: ['camel', 'Case', 'HTTP', 'Request']\n */\n\nexport const CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]+|[0-9]+/g;\n"],"mappings":";AAiBO,IAAM,qBAAqB;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CASE_SPLIT_PATTERN
|
|
3
|
+
} from "./chunk-IJJCMZIV.mjs";
|
|
4
|
+
|
|
5
|
+
// src/string/lowerCase.ts
|
|
6
|
+
var lowerCase = (str) => {
|
|
7
|
+
const splitWords = str.match(CASE_SPLIT_PATTERN) || [];
|
|
8
|
+
return splitWords.map((word) => word.toLowerCase()).join(" ");
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
lowerCase
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=chunk-KPFMOZXV.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/string/lowerCase.ts"],"sourcesContent":["import { CASE_SPLIT_PATTERN } from '../constants';\n\n/**\n * Converts a string to lower case.\n *\n * Lower case is the naming convention in which each word is written in lowercase and separated by an space ( ) character.\n *\n * @param {string} str - The string that is to be changed to lower case.\n * @returns {string} - The converted string to lower case.\n *\n * @example\n * const convertedStr1 = lowerCase('camelCase') // returns 'camel case'\n * const convertedStr2 = lowerCase('some whitespace') // returns 'some whitespace'\n * const convertedStr3 = lowerCase('hyphen-text') // returns 'hyphen text'\n * const convertedStr4 = lowerCase('HTTPRequest') // returns 'http request'\n */\n\nexport const lowerCase = (str: string): string => {\n const splitWords = str.match(CASE_SPLIT_PATTERN) || [];\n return splitWords.map(word => word.toLowerCase()).join(' ');\n};\n"],"mappings":";;;;;AAiBO,IAAM,YAAY,CAAC,QAAwB;AAChD,QAAM,aAAa,IAAI,MAAM,kBAAkB,KAAK,CAAC;AACrD,SAAO,WAAW,IAAI,UAAQ,KAAK,YAAY,CAAC,EAAE,KAAK,GAAG;AAC5D;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CASE_SPLIT_PATTERN
|
|
3
|
+
} from "./chunk-IJJCMZIV.mjs";
|
|
4
|
+
|
|
5
|
+
// src/string/kebabCase.ts
|
|
6
|
+
var kebabCase = (str) => {
|
|
7
|
+
const splitWords = str.match(CASE_SPLIT_PATTERN) || [];
|
|
8
|
+
return splitWords.map((word) => word.toLowerCase()).join("-");
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
kebabCase
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=chunk-XWJ7NQF4.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/string/kebabCase.ts"],"sourcesContent":["import { CASE_SPLIT_PATTERN } from '../constants';\n\n/**\n * Converts a string to kebab case.\n *\n * Kebab case is the naming convention in which each word is written in lowercase and separated by a dash (-) character.\n *\n * @param {string} str - The string that is to be changed to kebab case.\n * @returns {string} - The converted string to kebab case.\n *\n * @example\n * const convertedStr1 = kebabCase('camelCase') // returns 'camel-case'\n * const convertedStr2 = kebabCase('some whitespace') // returns 'some-whitespace'\n * const convertedStr3 = kebabCase('hyphen-text') // returns 'hyphen-text'\n * const convertedStr4 = kebabCase('HTTPRequest') // returns 'http-request'\n */\n\nexport const kebabCase = (str: string): string => {\n const splitWords = str.match(CASE_SPLIT_PATTERN) || [];\n return splitWords.map(word => word.toLowerCase()).join('-');\n};\n"],"mappings":";;;;;AAiBO,IAAM,YAAY,CAAC,QAAwB;AAChD,QAAM,aAAa,IAAI,MAAM,kBAAkB,KAAK,CAAC;AACrD,SAAO,WAAW,IAAI,UAAQ,KAAK,YAAY,CAAC,EAAE,KAAK,GAAG;AAC5D;","names":[]}
|
|
@@ -23,7 +23,7 @@ __export(caseSplitPattern_exports, {
|
|
|
23
23
|
CASE_SPLIT_PATTERN: () => CASE_SPLIT_PATTERN
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(caseSplitPattern_exports);
|
|
26
|
-
var CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]
|
|
26
|
+
var CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]+|[0-9]+/g;
|
|
27
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
28
|
0 && (module.exports = {
|
|
29
29
|
CASE_SPLIT_PATTERN
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants/caseSplitPattern.ts"],"sourcesContent":["/**\n * Regular expression pattern to split strings into words for various case conversions\n *\n * This pattern matchs sequences of characters in a string, considering the following case:\n * - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n * - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n * - Single uppercase letters\n * - Sequences of digis\n *\n * The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n * a consistent format like snake case.\n *\n * @example\n * const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n * // matchs: ['camel', 'Case', 'HTTP', 'Request']\n */\n\nexport const CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]
|
|
1
|
+
{"version":3,"sources":["../../src/constants/caseSplitPattern.ts"],"sourcesContent":["/**\n * Regular expression pattern to split strings into words for various case conversions\n *\n * This pattern matchs sequences of characters in a string, considering the following case:\n * - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n * - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n * - Single uppercase letters\n * - Sequences of digis\n *\n * The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n * a consistent format like snake case.\n *\n * @example\n * const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n * // matchs: ['camel', 'Case', 'HTTP', 'Request']\n */\n\nexport const CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]+|[0-9]+/g;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,IAAM,qBAAqB;","names":[]}
|
package/dist/constants/index.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(constants_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(constants_exports);
|
|
26
26
|
|
|
27
27
|
// src/constants/caseSplitPattern.ts
|
|
28
|
-
var CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]
|
|
28
|
+
var CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]+|[0-9]+/g;
|
|
29
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
30
|
0 && (module.exports = {
|
|
31
31
|
CASE_SPLIT_PATTERN
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants/index.ts","../../src/constants/caseSplitPattern.ts"],"sourcesContent":["export { CASE_SPLIT_PATTERN } from './caseSplitPattern';\n","/**\n * Regular expression pattern to split strings into words for various case conversions\n *\n * This pattern matchs sequences of characters in a string, considering the following case:\n * - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n * - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n * - Single uppercase letters\n * - Sequences of digis\n *\n * The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n * a consistent format like snake case.\n *\n * @example\n * const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n * // matchs: ['camel', 'Case', 'HTTP', 'Request']\n */\n\nexport const CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]
|
|
1
|
+
{"version":3,"sources":["../../src/constants/index.ts","../../src/constants/caseSplitPattern.ts"],"sourcesContent":["export { CASE_SPLIT_PATTERN } from './caseSplitPattern';\n","/**\n * Regular expression pattern to split strings into words for various case conversions\n *\n * This pattern matchs sequences of characters in a string, considering the following case:\n * - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n * - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n * - Single uppercase letters\n * - Sequences of digis\n *\n * The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n * a consistent format like snake case.\n *\n * @example\n * const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n * // matchs: ['camel', 'Case', 'HTTP', 'Request']\n */\n\nexport const CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]+|[0-9]+/g;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBO,IAAM,qBAAqB;","names":[]}
|
package/dist/constants/index.mjs
CHANGED
package/dist/function/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "../chunk-N6EM6ETS.mjs";
|
|
2
|
-
import {
|
|
3
|
-
debounce
|
|
4
|
-
} from "../chunk-3IP4JVLL.mjs";
|
|
5
|
-
import {
|
|
6
|
-
noop
|
|
7
|
-
} from "../chunk-LKXCOLNY.mjs";
|
|
8
2
|
import {
|
|
9
3
|
once
|
|
10
4
|
} from "../chunk-CMBC4MXG.mjs";
|
|
11
5
|
import {
|
|
12
6
|
throttle
|
|
13
7
|
} from "../chunk-QOJGMVVR.mjs";
|
|
8
|
+
import {
|
|
9
|
+
debounce
|
|
10
|
+
} from "../chunk-3IP4JVLL.mjs";
|
|
11
|
+
import {
|
|
12
|
+
noop
|
|
13
|
+
} from "../chunk-LKXCOLNY.mjs";
|
|
14
14
|
import "../chunk-2MM5EJJX.mjs";
|
|
15
15
|
export {
|
|
16
16
|
debounce,
|
package/dist/index.d.mts
CHANGED
|
@@ -72,4 +72,6 @@ export { isNull } from './predicate/isNull.mjs';
|
|
|
72
72
|
export { isUndefined } from './predicate/isUndefined.mjs';
|
|
73
73
|
export { delay } from './promise/delay.mjs';
|
|
74
74
|
export { snakeCase } from './string/snakeCase.mjs';
|
|
75
|
+
export { kebabCase } from './string/kebabCase.mjs';
|
|
76
|
+
export { lowerCase } from './string/lowerCase.mjs';
|
|
75
77
|
export { capitalize } from './string/capitalize.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -72,4 +72,6 @@ export { isNull } from './predicate/isNull.js';
|
|
|
72
72
|
export { isUndefined } from './predicate/isUndefined.js';
|
|
73
73
|
export { delay } from './promise/delay.js';
|
|
74
74
|
export { snakeCase } from './string/snakeCase.js';
|
|
75
|
+
export { kebabCase } from './string/kebabCase.js';
|
|
76
|
+
export { lowerCase } from './string/lowerCase.js';
|
|
75
77
|
export { capitalize } from './string/capitalize.js';
|
package/dist/index.js
CHANGED
|
@@ -64,8 +64,10 @@ __export(src_exports, {
|
|
|
64
64
|
isNotNil: () => isNotNil,
|
|
65
65
|
isNull: () => isNull,
|
|
66
66
|
isUndefined: () => isUndefined,
|
|
67
|
+
kebabCase: () => kebabCase,
|
|
67
68
|
keyBy: () => keyBy,
|
|
68
69
|
last: () => last,
|
|
70
|
+
lowerCase: () => lowerCase,
|
|
69
71
|
maxBy: () => maxBy,
|
|
70
72
|
mean: () => mean,
|
|
71
73
|
meanBy: () => meanBy,
|
|
@@ -844,7 +846,7 @@ function delay(ms, { signal } = {}) {
|
|
|
844
846
|
}
|
|
845
847
|
|
|
846
848
|
// src/constants/caseSplitPattern.ts
|
|
847
|
-
var CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]
|
|
849
|
+
var CASE_SPLIT_PATTERN = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]+|[0-9]+/g;
|
|
848
850
|
|
|
849
851
|
// src/string/snakeCase.ts
|
|
850
852
|
var snakeCase = (str) => {
|
|
@@ -852,6 +854,18 @@ var snakeCase = (str) => {
|
|
|
852
854
|
return splitWords.map((word) => word.toLowerCase()).join("_");
|
|
853
855
|
};
|
|
854
856
|
|
|
857
|
+
// src/string/kebabCase.ts
|
|
858
|
+
var kebabCase = (str) => {
|
|
859
|
+
const splitWords = str.match(CASE_SPLIT_PATTERN) || [];
|
|
860
|
+
return splitWords.map((word) => word.toLowerCase()).join("-");
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
// src/string/lowerCase.ts
|
|
864
|
+
var lowerCase = (str) => {
|
|
865
|
+
const splitWords = str.match(CASE_SPLIT_PATTERN) || [];
|
|
866
|
+
return splitWords.map((word) => word.toLowerCase()).join(" ");
|
|
867
|
+
};
|
|
868
|
+
|
|
855
869
|
// src/string/capitalize.ts
|
|
856
870
|
var capitalize = (str) => {
|
|
857
871
|
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
@@ -888,8 +902,10 @@ var capitalize = (str) => {
|
|
|
888
902
|
isNotNil,
|
|
889
903
|
isNull,
|
|
890
904
|
isUndefined,
|
|
905
|
+
kebabCase,
|
|
891
906
|
keyBy,
|
|
892
907
|
last,
|
|
908
|
+
lowerCase,
|
|
893
909
|
maxBy,
|
|
894
910
|
mean,
|
|
895
911
|
meanBy,
|