es-toolkit 1.37.2-dev.1250 → 1.37.2-dev.1253
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/{snakeCase-BwvoPi.js → snakeCase-6cG1f4.js} +0 -1
- package/dist/_chunk/{upperFirst-C7IztG.js → upperFirst-Cx78bs.js} +1 -1
- package/dist/array/at.d.mts +1 -1
- package/dist/array/at.d.ts +1 -1
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/index.js +25 -4
- package/dist/compat/string/words.mjs +23 -3
- package/dist/index.js +2 -2
- package/dist/object/index.js +1 -1
- package/dist/string/index.js +2 -2
- package/package.json +1 -1
package/dist/compat/index.js
CHANGED
|
@@ -10,8 +10,8 @@ const isPlainObject$1 = require('../_chunk/isPlainObject-Xaozpc.js');
|
|
|
10
10
|
const range$1 = require('../_chunk/range-DSpBDL.js');
|
|
11
11
|
const randomInt = require('../_chunk/randomInt-CF7bZK.js');
|
|
12
12
|
const noop = require('../_chunk/noop-2IwLUk.js');
|
|
13
|
-
const snakeCase$1 = require('../_chunk/snakeCase-
|
|
14
|
-
const upperFirst$1 = require('../_chunk/upperFirst-
|
|
13
|
+
const snakeCase$1 = require('../_chunk/snakeCase-6cG1f4.js');
|
|
14
|
+
const upperFirst$1 = require('../_chunk/upperFirst-Cx78bs.js');
|
|
15
15
|
|
|
16
16
|
function castArray(value) {
|
|
17
17
|
if (arguments.length === 0) {
|
|
@@ -3874,9 +3874,30 @@ function upperFirst(str) {
|
|
|
3874
3874
|
return upperFirst$1.upperFirst(toString(str));
|
|
3875
3875
|
}
|
|
3876
3876
|
|
|
3877
|
-
|
|
3877
|
+
const rNonCharLatin = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\xd7\\xf7';
|
|
3878
|
+
const rUnicodeUpper = '\\p{Lu}';
|
|
3879
|
+
const rUnicodeLower = '\\p{Ll}';
|
|
3880
|
+
const rMisc = '(?:[\\p{Lm}\\p{Lo}]\\p{M}*)';
|
|
3881
|
+
const rNumber = '\\d';
|
|
3882
|
+
const rUnicodeOptContrLower = "(?:['\u2019](?:d|ll|m|re|s|t|ve))?";
|
|
3883
|
+
const rUnicodeOptContrUpper = "(?:['\u2019](?:D|LL|M|RE|S|T|VE))?";
|
|
3884
|
+
const rUnicodeBreak = `[\\p{Z}\\p{P}${rNonCharLatin}]`;
|
|
3885
|
+
const rUnicodeMiscUpper = `(?:${rUnicodeUpper}|${rMisc})`;
|
|
3886
|
+
const rUnicodeMiscLower = `(?:${rUnicodeLower}|${rMisc})`;
|
|
3887
|
+
const rUnicodeWord = RegExp([
|
|
3888
|
+
`${rUnicodeUpper}?${rUnicodeLower}+${rUnicodeOptContrLower}(?=${rUnicodeBreak}|${rUnicodeUpper}|$)`,
|
|
3889
|
+
`${rUnicodeMiscUpper}+${rUnicodeOptContrUpper}(?=${rUnicodeBreak}|${rUnicodeUpper}${rUnicodeMiscLower}|$)`,
|
|
3890
|
+
`${rUnicodeUpper}?${rUnicodeMiscLower}+${rUnicodeOptContrLower}`,
|
|
3891
|
+
`${rUnicodeUpper}+${rUnicodeOptContrUpper}`,
|
|
3892
|
+
`${rNumber}*(?:1ST|2ND|3RD|(?![123])${rNumber}TH)(?=\\b|[a-z_])`,
|
|
3893
|
+
`${rNumber}*(?:1st|2nd|3rd|(?![123])${rNumber}th)(?=\\b|[A-Z_])`,
|
|
3894
|
+
`${rNumber}+`,
|
|
3895
|
+
'\\p{Emoji_Presentation}',
|
|
3896
|
+
'\\p{Extended_Pictographic}',
|
|
3897
|
+
].join('|'), 'gu');
|
|
3898
|
+
function words(str, pattern = rUnicodeWord, guard) {
|
|
3878
3899
|
const input = toString(str);
|
|
3879
|
-
pattern = guard ?
|
|
3900
|
+
pattern = guard ? rUnicodeWord : pattern;
|
|
3880
3901
|
const words = Array.from(input.match(pattern) ?? []);
|
|
3881
3902
|
return words.filter(x => x !== '');
|
|
3882
3903
|
}
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
import { CASE_SPLIT_PATTERN } from '../../string/words.mjs';
|
|
2
1
|
import { toString } from '../util/toString.mjs';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
const rNonCharLatin = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\xd7\\xf7';
|
|
4
|
+
const rUnicodeUpper = '\\p{Lu}';
|
|
5
|
+
const rUnicodeLower = '\\p{Ll}';
|
|
6
|
+
const rMisc = '(?:[\\p{Lm}\\p{Lo}]\\p{M}*)';
|
|
7
|
+
const rNumber = '\\d';
|
|
8
|
+
const rUnicodeOptContrLower = "(?:['\u2019](?:d|ll|m|re|s|t|ve))?";
|
|
9
|
+
const rUnicodeOptContrUpper = "(?:['\u2019](?:D|LL|M|RE|S|T|VE))?";
|
|
10
|
+
const rUnicodeBreak = `[\\p{Z}\\p{P}${rNonCharLatin}]`;
|
|
11
|
+
const rUnicodeMiscUpper = `(?:${rUnicodeUpper}|${rMisc})`;
|
|
12
|
+
const rUnicodeMiscLower = `(?:${rUnicodeLower}|${rMisc})`;
|
|
13
|
+
const rUnicodeWord = RegExp([
|
|
14
|
+
`${rUnicodeUpper}?${rUnicodeLower}+${rUnicodeOptContrLower}(?=${rUnicodeBreak}|${rUnicodeUpper}|$)`,
|
|
15
|
+
`${rUnicodeMiscUpper}+${rUnicodeOptContrUpper}(?=${rUnicodeBreak}|${rUnicodeUpper}${rUnicodeMiscLower}|$)`,
|
|
16
|
+
`${rUnicodeUpper}?${rUnicodeMiscLower}+${rUnicodeOptContrLower}`,
|
|
17
|
+
`${rUnicodeUpper}+${rUnicodeOptContrUpper}`,
|
|
18
|
+
`${rNumber}*(?:1ST|2ND|3RD|(?![123])${rNumber}TH)(?=\\b|[a-z_])`,
|
|
19
|
+
`${rNumber}*(?:1st|2nd|3rd|(?![123])${rNumber}th)(?=\\b|[A-Z_])`,
|
|
20
|
+
`${rNumber}+`,
|
|
21
|
+
'\\p{Emoji_Presentation}',
|
|
22
|
+
'\\p{Extended_Pictographic}',
|
|
23
|
+
].join('|'), 'gu');
|
|
24
|
+
function words(str, pattern = rUnicodeWord, guard) {
|
|
5
25
|
const input = toString(str);
|
|
6
|
-
pattern = guard ?
|
|
26
|
+
pattern = guard ? rUnicodeWord : pattern;
|
|
7
27
|
const words = Array.from(input.match(pattern) ?? []);
|
|
8
28
|
return words.filter(x => x !== '');
|
|
9
29
|
}
|
package/dist/index.js
CHANGED
|
@@ -19,9 +19,9 @@ const predicate_index = require('./predicate/index.js');
|
|
|
19
19
|
const isPlainObject$1 = require('./_chunk/isPlainObject-Xaozpc.js');
|
|
20
20
|
const delay = require('./_chunk/delay-_VMfFa.js');
|
|
21
21
|
const promise_index = require('./promise/index.js');
|
|
22
|
-
const snakeCase = require('./_chunk/snakeCase-
|
|
22
|
+
const snakeCase = require('./_chunk/snakeCase-6cG1f4.js');
|
|
23
23
|
const string_index = require('./string/index.js');
|
|
24
|
-
const upperFirst = require('./_chunk/upperFirst-
|
|
24
|
+
const upperFirst = require('./_chunk/upperFirst-Cx78bs.js');
|
|
25
25
|
const util_index = require('./util/index.js');
|
|
26
26
|
|
|
27
27
|
|
package/dist/object/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const isPlainObject = require('../_chunk/isPlainObject-DINLyA.js');
|
|
6
6
|
const isPlainObject$1 = require('../_chunk/isPlainObject-Xaozpc.js');
|
|
7
|
-
const snakeCase = require('../_chunk/snakeCase-
|
|
7
|
+
const snakeCase = require('../_chunk/snakeCase-6cG1f4.js');
|
|
8
8
|
|
|
9
9
|
function flattenObject(object, { delimiter = '.' } = {}) {
|
|
10
10
|
return flattenObjectImpl(object, '', delimiter);
|
package/dist/string/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const snakeCase = require('../_chunk/snakeCase-
|
|
6
|
-
const upperFirst = require('../_chunk/upperFirst-
|
|
5
|
+
const snakeCase = require('../_chunk/snakeCase-6cG1f4.js');
|
|
6
|
+
const upperFirst = require('../_chunk/upperFirst-Cx78bs.js');
|
|
7
7
|
|
|
8
8
|
function constantCase(str) {
|
|
9
9
|
const words = snakeCase.words(str);
|
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.37.2-dev.
|
|
4
|
+
"version": "1.37.2-dev.1253+d14d8de4",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|