es-toolkit 1.9.0-dev.187 → 1.9.0-dev.189
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 +31 -31
- package/dist/chunk-5IKVJGHO.mjs +14 -0
- package/dist/chunk-5IKVJGHO.mjs.map +1 -0
- package/dist/chunk-EYYZQFOP.mjs +14 -0
- package/dist/chunk-EYYZQFOP.mjs.map +1 -0
- package/dist/chunk-F3WCQQET.mjs +14 -0
- package/dist/chunk-F3WCQQET.mjs.map +1 -0
- package/dist/chunk-WVQ7YVRK.mjs +11 -0
- package/dist/chunk-WVQ7YVRK.mjs.map +1 -0
- package/dist/function/index.mjs +6 -6
- package/dist/index.js +12 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -62
- package/dist/math/index.mjs +9 -9
- package/dist/object/index.mjs +6 -6
- package/dist/predicate/index.mjs +6 -6
- package/dist/string/index.js +12 -15
- package/dist/string/index.js.map +1 -1
- package/dist/string/index.mjs +6 -7
- package/dist/string/kebabCase.js +8 -4
- package/dist/string/kebabCase.js.map +1 -1
- package/dist/string/kebabCase.mjs +2 -3
- package/dist/string/lowerCase.js +8 -11
- package/dist/string/lowerCase.js.map +1 -1
- package/dist/string/lowerCase.mjs +2 -3
- package/dist/string/snakeCase.js +8 -4
- package/dist/string/snakeCase.js.map +1 -1
- package/dist/string/snakeCase.mjs +2 -3
- package/package.json +1 -1
- package/dist/chunk-2AWSOSQI.mjs +0 -21
- package/dist/chunk-2AWSOSQI.mjs.map +0 -1
- package/dist/chunk-2M3YVRFS.mjs +0 -1
- package/dist/chunk-2M3YVRFS.mjs.map +0 -1
- package/dist/chunk-47QP3LTV.mjs +0 -14
- package/dist/chunk-47QP3LTV.mjs.map +0 -1
- package/dist/chunk-IJJCMZIV.mjs +0 -7
- package/dist/chunk-IJJCMZIV.mjs.map +0 -1
- package/dist/chunk-XWJ7NQF4.mjs +0 -14
- package/dist/chunk-XWJ7NQF4.mjs.map +0 -1
- package/dist/constants/caseSplitPattern.d.mts +0 -19
- package/dist/constants/caseSplitPattern.d.ts +0 -19
- package/dist/constants/caseSplitPattern.js +0 -31
- package/dist/constants/caseSplitPattern.js.map +0 -1
- package/dist/constants/caseSplitPattern.mjs +0 -8
- package/dist/constants/caseSplitPattern.mjs.map +0 -1
- package/dist/constants/index.d.mts +0 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.js +0 -33
- package/dist/constants/index.js.map +0 -1
- package/dist/constants/index.mjs +0 -9
- package/dist/constants/index.mjs.map +0 -1
package/dist/chunk-IJJCMZIV.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
package/dist/chunk-XWJ7NQF4.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Regular expression pattern to split strings into words for various case conversions
|
|
3
|
-
*
|
|
4
|
-
* This pattern matchs sequences of characters in a string, considering the following case:
|
|
5
|
-
* - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)
|
|
6
|
-
* - Sequences of one uppercase letter optionally followed by lowercase letters and digits
|
|
7
|
-
* - Single uppercase letters
|
|
8
|
-
* - Sequences of digis
|
|
9
|
-
*
|
|
10
|
-
* The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into
|
|
11
|
-
* a consistent format like snake case.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);
|
|
15
|
-
* // matchs: ['camel', 'Case', 'HTTP', 'Request']
|
|
16
|
-
*/
|
|
17
|
-
declare const CASE_SPLIT_PATTERN: RegExp;
|
|
18
|
-
|
|
19
|
-
export { CASE_SPLIT_PATTERN };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Regular expression pattern to split strings into words for various case conversions
|
|
3
|
-
*
|
|
4
|
-
* This pattern matchs sequences of characters in a string, considering the following case:
|
|
5
|
-
* - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)
|
|
6
|
-
* - Sequences of one uppercase letter optionally followed by lowercase letters and digits
|
|
7
|
-
* - Single uppercase letters
|
|
8
|
-
* - Sequences of digis
|
|
9
|
-
*
|
|
10
|
-
* The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into
|
|
11
|
-
* a consistent format like snake case.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);
|
|
15
|
-
* // matchs: ['camel', 'Case', 'HTTP', 'Request']
|
|
16
|
-
*/
|
|
17
|
-
declare const CASE_SPLIT_PATTERN: RegExp;
|
|
18
|
-
|
|
19
|
-
export { CASE_SPLIT_PATTERN };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/constants/caseSplitPattern.ts
|
|
21
|
-
var caseSplitPattern_exports = {};
|
|
22
|
-
__export(caseSplitPattern_exports, {
|
|
23
|
-
CASE_SPLIT_PATTERN: () => CASE_SPLIT_PATTERN
|
|
24
|
-
});
|
|
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]+|[0-9]+/g;
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
CASE_SPLIT_PATTERN
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=caseSplitPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CASE_SPLIT_PATTERN } from './caseSplitPattern.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CASE_SPLIT_PATTERN } from './caseSplitPattern.js';
|
package/dist/constants/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/constants/index.ts
|
|
21
|
-
var constants_exports = {};
|
|
22
|
-
__export(constants_exports, {
|
|
23
|
-
CASE_SPLIT_PATTERN: () => CASE_SPLIT_PATTERN
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(constants_exports);
|
|
26
|
-
|
|
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]+|[0-9]+/g;
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
CASE_SPLIT_PATTERN
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|