es-toolkit 1.34.0 → 1.34.1-dev.1079
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/CHANGELOG.md +6 -0
- package/dist/_chunk/{isWeakSet-CQZSI-.js → isWeakSet-C2NpfO.js} +2 -2
- package/dist/_chunk/{upperFirst-nA5L7X.js → upperFirst-DO8xaZ.js} +3 -0
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/index.js +2 -2
- package/dist/index.js +2 -2
- package/dist/predicate/index.js +1 -1
- package/dist/predicate/isBrowser.mjs +1 -1
- package/dist/predicate/isNode.mjs +1 -1
- package/dist/string/index.js +1 -1
- package/dist/string/trimEnd.d.mts +3 -0
- package/dist/string/trimEnd.d.ts +3 -0
- package/dist/string/trimEnd.mjs +3 -0
- package/dist/string/trimStart.d.mts +3 -0
- package/dist/string/trimStart.d.ts +3 -0
- package/package.json +1 -1
package/dist/compat/index.js
CHANGED
|
@@ -11,9 +11,9 @@ const range$1 = require('../_chunk/range-HnEIT7.js');
|
|
|
11
11
|
const randomInt = require('../_chunk/randomInt-CF7bZK.js');
|
|
12
12
|
const toMerged = require('../_chunk/toMerged-CwnQF6.js');
|
|
13
13
|
const isPlainObject$1 = require('../_chunk/isPlainObject-Xaozpc.js');
|
|
14
|
-
const isWeakSet$1 = require('../_chunk/isWeakSet-
|
|
14
|
+
const isWeakSet$1 = require('../_chunk/isWeakSet-C2NpfO.js');
|
|
15
15
|
const promise_index = require('../promise/index.js');
|
|
16
|
-
const upperFirst$1 = require('../_chunk/upperFirst-
|
|
16
|
+
const upperFirst$1 = require('../_chunk/upperFirst-DO8xaZ.js');
|
|
17
17
|
const invariant = require('../_chunk/invariant-BfGFfr.js');
|
|
18
18
|
|
|
19
19
|
function castArray(value) {
|
package/dist/index.js
CHANGED
|
@@ -14,12 +14,12 @@ const randomInt = require('./_chunk/randomInt-CF7bZK.js');
|
|
|
14
14
|
const math_index = require('./math/index.js');
|
|
15
15
|
const toMerged = require('./_chunk/toMerged-CwnQF6.js');
|
|
16
16
|
const object_index = require('./object/index.js');
|
|
17
|
-
const isWeakSet = require('./_chunk/isWeakSet-
|
|
17
|
+
const isWeakSet = require('./_chunk/isWeakSet-C2NpfO.js');
|
|
18
18
|
const predicate_index = require('./predicate/index.js');
|
|
19
19
|
const isPlainObject = 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 upperFirst = require('./_chunk/upperFirst-
|
|
22
|
+
const upperFirst = require('./_chunk/upperFirst-DO8xaZ.js');
|
|
23
23
|
const string_index = require('./string/index.js');
|
|
24
24
|
const util_index = require('./util/index.js');
|
|
25
25
|
const invariant = require('./_chunk/invariant-BfGFfr.js');
|
package/dist/predicate/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const isWeakSet = require('../_chunk/isWeakSet-
|
|
5
|
+
const isWeakSet = require('../_chunk/isWeakSet-C2NpfO.js');
|
|
6
6
|
const isPlainObject = require('../_chunk/isPlainObject-Xaozpc.js');
|
|
7
7
|
|
|
8
8
|
function isBoolean(x) {
|
package/dist/string/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const upperFirst = require('../_chunk/upperFirst-
|
|
5
|
+
const upperFirst = require('../_chunk/upperFirst-DO8xaZ.js');
|
|
6
6
|
|
|
7
7
|
function startCase(str) {
|
|
8
8
|
const words = upperFirst.words(str.trim());
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Removes trailing whitespace or specified characters from a string.
|
|
3
3
|
*
|
|
4
|
+
* If `chars` is a string, it should be a single character. To trim a string with multiple characters,
|
|
5
|
+
* provide an array instead.
|
|
6
|
+
*
|
|
4
7
|
* @param {string} str - The string from which trailing characters will be trimmed.
|
|
5
8
|
* @param {string | string[]} chars - The character(s) to remove from the end of the string.
|
|
6
9
|
* @returns {string} - The resulting string after the specified trailing character has been removed.
|
package/dist/string/trimEnd.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Removes trailing whitespace or specified characters from a string.
|
|
3
3
|
*
|
|
4
|
+
* If `chars` is a string, it should be a single character. To trim a string with multiple characters,
|
|
5
|
+
* provide an array instead.
|
|
6
|
+
*
|
|
4
7
|
* @param {string} str - The string from which trailing characters will be trimmed.
|
|
5
8
|
* @param {string | string[]} chars - The character(s) to remove from the end of the string.
|
|
6
9
|
* @returns {string} - The resulting string after the specified trailing character has been removed.
|
package/dist/string/trimEnd.mjs
CHANGED
|
@@ -5,6 +5,9 @@ function trimEnd(str, chars) {
|
|
|
5
5
|
let endIndex = str.length;
|
|
6
6
|
switch (typeof chars) {
|
|
7
7
|
case 'string': {
|
|
8
|
+
if (chars.length !== 1) {
|
|
9
|
+
throw new Error(`The 'chars' parameter should be a single character string.`);
|
|
10
|
+
}
|
|
8
11
|
while (endIndex > 0 && str[endIndex - 1] === chars) {
|
|
9
12
|
endIndex--;
|
|
10
13
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Removes leading whitespace or specified characters from a string.
|
|
3
3
|
*
|
|
4
|
+
* If `chars` is a string, it should be a single character. To trim a string with multiple characters,
|
|
5
|
+
* provide an array instead.
|
|
6
|
+
*
|
|
4
7
|
* @param {string} str - The string from which leading characters will be trimmed.
|
|
5
8
|
* @param {string | string[]} chars - The character(s) to remove from the start of the string.
|
|
6
9
|
* @returns {string} - The resulting string after the specified leading character has been removed.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Removes leading whitespace or specified characters from a string.
|
|
3
3
|
*
|
|
4
|
+
* If `chars` is a string, it should be a single character. To trim a string with multiple characters,
|
|
5
|
+
* provide an array instead.
|
|
6
|
+
*
|
|
4
7
|
* @param {string} str - The string from which leading characters will be trimmed.
|
|
5
8
|
* @param {string | string[]} chars - The character(s) to remove from the start of the string.
|
|
6
9
|
* @returns {string} - The resulting string after the specified leading character has been removed.
|
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.34.
|
|
4
|
+
"version": "1.34.1-dev.1079+4069aa6b",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|