es-toolkit 1.17.0-dev.527 → 1.17.0-dev.529
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-crEecP.js +513 -0
- package/dist/array/index.js +56 -510
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/_internal/compareValues.mjs +30 -5
- package/dist/compat/array/orderBy.d.mts +6 -6
- package/dist/compat/array/orderBy.d.ts +6 -6
- package/dist/compat/array/orderBy.mjs +26 -18
- package/dist/compat/array/sortBy.d.mts +34 -0
- package/dist/compat/array/sortBy.d.ts +34 -0
- package/dist/compat/array/sortBy.mjs +7 -0
- package/dist/compat/index.d.mts +2 -1
- package/dist/compat/index.d.ts +2 -1
- package/dist/compat/index.js +120 -82
- package/dist/compat/index.mjs +2 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +57 -55
- package/dist/index.mjs +1 -0
- package/dist/string/escapeRegExp.d.mts +9 -0
- package/dist/string/escapeRegExp.d.ts +9 -0
- package/dist/string/escapeRegExp.mjs +5 -0
- package/dist/string/index.d.mts +1 -0
- package/dist/string/index.d.ts +1 -0
- package/dist/string/index.js +5 -0
- package/dist/string/index.mjs +1 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -124,5 +124,6 @@ export { upperFirst } from './string/upperFirst.mjs';
|
|
|
124
124
|
export { lowerFirst } from './string/lowerFirst.mjs';
|
|
125
125
|
export { deburr } from './string/deburr.mjs';
|
|
126
126
|
export { escape } from './string/escape.mjs';
|
|
127
|
+
export { escapeRegExp } from './string/escapeRegExp.mjs';
|
|
127
128
|
export { unescape } from './string/unescape.mjs';
|
|
128
129
|
export { pad } from './string/pad.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -124,5 +124,6 @@ export { upperFirst } from './string/upperFirst.js';
|
|
|
124
124
|
export { lowerFirst } from './string/lowerFirst.js';
|
|
125
125
|
export { deburr } from './string/deburr.js';
|
|
126
126
|
export { escape } from './string/escape.js';
|
|
127
|
+
export { escapeRegExp } from './string/escapeRegExp.js';
|
|
127
128
|
export { unescape } from './string/unescape.js';
|
|
128
129
|
export { pad } from './string/pad.js';
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
+
const initial = require('./_chunk/initial-crEecP.js');
|
|
5
6
|
const array_index = require('./array/index.js');
|
|
6
7
|
const promise_index = require('./_chunk/index-BGZDR9.js');
|
|
7
8
|
const rest = require('./_chunk/rest-Bzm2XK.js');
|
|
@@ -17,63 +18,63 @@ const string_index = require('./string/index.js');
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
exports.at =
|
|
21
|
-
exports.chunk =
|
|
22
|
-
exports.compact =
|
|
23
|
-
exports.countBy =
|
|
24
|
-
exports.difference =
|
|
25
|
-
exports.differenceBy =
|
|
26
|
-
exports.differenceWith =
|
|
27
|
-
exports.drop =
|
|
28
|
-
exports.dropRight =
|
|
29
|
-
exports.dropRightWhile =
|
|
30
|
-
exports.dropWhile =
|
|
31
|
-
exports.fill =
|
|
32
|
-
exports.flatMap =
|
|
33
|
-
exports.flatMapDeep =
|
|
34
|
-
exports.flatten =
|
|
35
|
-
exports.flattenDeep =
|
|
36
|
-
exports.forEachRight =
|
|
37
|
-
exports.groupBy =
|
|
38
|
-
exports.head =
|
|
39
|
-
exports.initial =
|
|
40
|
-
exports.intersection =
|
|
41
|
-
exports.intersectionBy =
|
|
42
|
-
exports.intersectionWith =
|
|
43
|
-
exports.isSubset =
|
|
44
|
-
exports.join =
|
|
45
|
-
exports.keyBy =
|
|
46
|
-
exports.last =
|
|
47
|
-
exports.maxBy =
|
|
48
|
-
exports.minBy =
|
|
21
|
+
exports.at = initial.at;
|
|
22
|
+
exports.chunk = initial.chunk;
|
|
23
|
+
exports.compact = initial.compact;
|
|
24
|
+
exports.countBy = initial.countBy;
|
|
25
|
+
exports.difference = initial.difference;
|
|
26
|
+
exports.differenceBy = initial.differenceBy;
|
|
27
|
+
exports.differenceWith = initial.differenceWith;
|
|
28
|
+
exports.drop = initial.drop;
|
|
29
|
+
exports.dropRight = initial.dropRight;
|
|
30
|
+
exports.dropRightWhile = initial.dropRightWhile;
|
|
31
|
+
exports.dropWhile = initial.dropWhile;
|
|
32
|
+
exports.fill = initial.fill;
|
|
33
|
+
exports.flatMap = initial.flatMap;
|
|
34
|
+
exports.flatMapDeep = initial.flatMapDeep;
|
|
35
|
+
exports.flatten = initial.flatten;
|
|
36
|
+
exports.flattenDeep = initial.flattenDeep;
|
|
37
|
+
exports.forEachRight = initial.forEachRight;
|
|
38
|
+
exports.groupBy = initial.groupBy;
|
|
39
|
+
exports.head = initial.head;
|
|
40
|
+
exports.initial = initial.initial;
|
|
41
|
+
exports.intersection = initial.intersection;
|
|
42
|
+
exports.intersectionBy = initial.intersectionBy;
|
|
43
|
+
exports.intersectionWith = initial.intersectionWith;
|
|
44
|
+
exports.isSubset = initial.isSubset;
|
|
45
|
+
exports.join = initial.join;
|
|
46
|
+
exports.keyBy = initial.keyBy;
|
|
47
|
+
exports.last = initial.last;
|
|
48
|
+
exports.maxBy = initial.maxBy;
|
|
49
|
+
exports.minBy = initial.minBy;
|
|
50
|
+
exports.partition = initial.partition;
|
|
51
|
+
exports.pullAt = initial.pullAt;
|
|
52
|
+
exports.sample = initial.sample;
|
|
53
|
+
exports.sampleSize = initial.sampleSize;
|
|
54
|
+
exports.shuffle = initial.shuffle;
|
|
55
|
+
exports.tail = initial.tail;
|
|
56
|
+
exports.take = initial.take;
|
|
57
|
+
exports.takeRight = initial.takeRight;
|
|
58
|
+
exports.takeRightWhile = initial.takeRightWhile;
|
|
59
|
+
exports.takeWhile = initial.takeWhile;
|
|
60
|
+
exports.toFilled = initial.toFilled;
|
|
61
|
+
exports.union = initial.union;
|
|
62
|
+
exports.unionBy = initial.unionBy;
|
|
63
|
+
exports.unionWith = initial.unionWith;
|
|
64
|
+
exports.uniq = initial.uniq;
|
|
65
|
+
exports.uniqBy = initial.uniqBy;
|
|
66
|
+
exports.uniqWith = initial.uniqWith;
|
|
67
|
+
exports.unzip = initial.unzip;
|
|
68
|
+
exports.unzipWith = initial.unzipWith;
|
|
69
|
+
exports.without = initial.without;
|
|
70
|
+
exports.xor = initial.xor;
|
|
71
|
+
exports.xorBy = initial.xorBy;
|
|
72
|
+
exports.xorWith = initial.xorWith;
|
|
73
|
+
exports.zip = initial.zip;
|
|
74
|
+
exports.zipObject = initial.zipObject;
|
|
75
|
+
exports.zipWith = initial.zipWith;
|
|
49
76
|
exports.orderBy = array_index.orderBy;
|
|
50
|
-
exports.partition = array_index.partition;
|
|
51
|
-
exports.pullAt = array_index.pullAt;
|
|
52
|
-
exports.sample = array_index.sample;
|
|
53
|
-
exports.sampleSize = array_index.sampleSize;
|
|
54
|
-
exports.shuffle = array_index.shuffle;
|
|
55
77
|
exports.sortBy = array_index.sortBy;
|
|
56
|
-
exports.tail = array_index.tail;
|
|
57
|
-
exports.take = array_index.take;
|
|
58
|
-
exports.takeRight = array_index.takeRight;
|
|
59
|
-
exports.takeRightWhile = array_index.takeRightWhile;
|
|
60
|
-
exports.takeWhile = array_index.takeWhile;
|
|
61
|
-
exports.toFilled = array_index.toFilled;
|
|
62
|
-
exports.union = array_index.union;
|
|
63
|
-
exports.unionBy = array_index.unionBy;
|
|
64
|
-
exports.unionWith = array_index.unionWith;
|
|
65
|
-
exports.uniq = array_index.uniq;
|
|
66
|
-
exports.uniqBy = array_index.uniqBy;
|
|
67
|
-
exports.uniqWith = array_index.uniqWith;
|
|
68
|
-
exports.unzip = array_index.unzip;
|
|
69
|
-
exports.unzipWith = array_index.unzipWith;
|
|
70
|
-
exports.without = array_index.without;
|
|
71
|
-
exports.xor = array_index.xor;
|
|
72
|
-
exports.xorBy = array_index.xorBy;
|
|
73
|
-
exports.xorWith = array_index.xorWith;
|
|
74
|
-
exports.zip = array_index.zip;
|
|
75
|
-
exports.zipObject = array_index.zipObject;
|
|
76
|
-
exports.zipWith = array_index.zipWith;
|
|
77
78
|
exports.AbortError = promise_index.AbortError;
|
|
78
79
|
exports.TimeoutError = promise_index.TimeoutError;
|
|
79
80
|
exports.delay = promise_index.delay;
|
|
@@ -136,6 +137,7 @@ exports.camelCase = string_index.camelCase;
|
|
|
136
137
|
exports.capitalize = string_index.capitalize;
|
|
137
138
|
exports.deburr = string_index.deburr;
|
|
138
139
|
exports.escape = string_index.escape;
|
|
140
|
+
exports.escapeRegExp = string_index.escapeRegExp;
|
|
139
141
|
exports.kebabCase = string_index.kebabCase;
|
|
140
142
|
exports.lowerCase = string_index.lowerCase;
|
|
141
143
|
exports.lowerFirst = string_index.lowerFirst;
|
package/dist/index.mjs
CHANGED
|
@@ -124,5 +124,6 @@ export { upperFirst } from './string/upperFirst.mjs';
|
|
|
124
124
|
export { lowerFirst } from './string/lowerFirst.mjs';
|
|
125
125
|
export { deburr } from './string/deburr.mjs';
|
|
126
126
|
export { escape } from './string/escape.mjs';
|
|
127
|
+
export { escapeRegExp } from './string/escapeRegExp.mjs';
|
|
127
128
|
export { unescape } from './string/unescape.mjs';
|
|
128
129
|
export { pad } from './string/pad.mjs';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escapes the RegExp special characters "^", "$", "\\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in `str`.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} str The string to escape.
|
|
5
|
+
* @returns {string} Returns the escaped string.
|
|
6
|
+
*/
|
|
7
|
+
declare function escapeRegExp(str: string): string;
|
|
8
|
+
|
|
9
|
+
export { escapeRegExp };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escapes the RegExp special characters "^", "$", "\\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in `str`.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} str The string to escape.
|
|
5
|
+
* @returns {string} Returns the escaped string.
|
|
6
|
+
*/
|
|
7
|
+
declare function escapeRegExp(str: string): string;
|
|
8
|
+
|
|
9
|
+
export { escapeRegExp };
|
package/dist/string/index.d.mts
CHANGED
|
@@ -9,5 +9,6 @@ export { upperFirst } from './upperFirst.mjs';
|
|
|
9
9
|
export { lowerFirst } from './lowerFirst.mjs';
|
|
10
10
|
export { deburr } from './deburr.mjs';
|
|
11
11
|
export { escape } from './escape.mjs';
|
|
12
|
+
export { escapeRegExp } from './escapeRegExp.mjs';
|
|
12
13
|
export { unescape } from './unescape.mjs';
|
|
13
14
|
export { pad } from './pad.mjs';
|
package/dist/string/index.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export { upperFirst } from './upperFirst.js';
|
|
|
9
9
|
export { lowerFirst } from './lowerFirst.js';
|
|
10
10
|
export { deburr } from './deburr.js';
|
|
11
11
|
export { escape } from './escape.js';
|
|
12
|
+
export { escapeRegExp } from './escapeRegExp.js';
|
|
12
13
|
export { unescape } from './unescape.js';
|
|
13
14
|
export { pad } from './pad.js';
|
package/dist/string/index.js
CHANGED
|
@@ -120,6 +120,10 @@ function escape(str) {
|
|
|
120
120
|
return str.replace(/[&<>"']/g, match => htmlEscapes[match]);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
function escapeRegExp(str) {
|
|
124
|
+
return str.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&');
|
|
125
|
+
}
|
|
126
|
+
|
|
123
127
|
const htmlUnescapes = {
|
|
124
128
|
'&': '&',
|
|
125
129
|
'<': '<',
|
|
@@ -139,6 +143,7 @@ exports.camelCase = camelCase;
|
|
|
139
143
|
exports.capitalize = capitalize;
|
|
140
144
|
exports.deburr = deburr;
|
|
141
145
|
exports.escape = escape;
|
|
146
|
+
exports.escapeRegExp = escapeRegExp;
|
|
142
147
|
exports.kebabCase = kebabCase;
|
|
143
148
|
exports.lowerCase = lowerCase;
|
|
144
149
|
exports.lowerFirst = lowerFirst;
|
package/dist/string/index.mjs
CHANGED
|
@@ -9,5 +9,6 @@ export { upperFirst } from './upperFirst.mjs';
|
|
|
9
9
|
export { lowerFirst } from './lowerFirst.mjs';
|
|
10
10
|
export { deburr } from './deburr.mjs';
|
|
11
11
|
export { escape } from './escape.mjs';
|
|
12
|
+
export { escapeRegExp } from './escapeRegExp.mjs';
|
|
12
13
|
export { unescape } from './unescape.mjs';
|
|
13
14
|
export { pad } from './pad.mjs';
|
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.529+6ba0d7b9",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|