es-toolkit 1.17.0-dev.513 → 1.17.0-dev.515
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/string/index.js
CHANGED
|
@@ -109,9 +109,9 @@ function deburr(str) {
|
|
|
109
109
|
return result.join('');
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
function pad(str, length, chars = ' ') {
|
|
113
113
|
return str.padStart(Math.floor((length - str.length) / 2) + str.length, chars).padEnd(length, chars);
|
|
114
|
-
}
|
|
114
|
+
}
|
|
115
115
|
|
|
116
116
|
exports.camelCase = camelCase;
|
|
117
117
|
exports.capitalize = capitalize;
|
package/dist/string/pad.d.mts
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
* Pads string on the left and right sides if it's shorter than length. Padding characters are truncated if they can't be evenly divided by length.
|
|
3
3
|
* If the length is less than or equal to the original string's length, or if the padding character is an empty string, the original string is returned unchanged.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
5
|
* @param {string} str - The string to pad.
|
|
8
6
|
* @param {number} [length] - The length of the resulting string once padded.
|
|
9
7
|
* @param {string} [chars] - The character(s) to use for padding.
|
|
@@ -16,6 +14,6 @@
|
|
|
16
14
|
* const result4 = pad('abc', 2); // result will be 'abc'
|
|
17
15
|
*
|
|
18
16
|
*/
|
|
19
|
-
declare
|
|
17
|
+
declare function pad(str: string, length: number, chars?: string): string;
|
|
20
18
|
|
|
21
19
|
export { pad };
|
package/dist/string/pad.d.ts
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
* Pads string on the left and right sides if it's shorter than length. Padding characters are truncated if they can't be evenly divided by length.
|
|
3
3
|
* If the length is less than or equal to the original string's length, or if the padding character is an empty string, the original string is returned unchanged.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
5
|
* @param {string} str - The string to pad.
|
|
8
6
|
* @param {number} [length] - The length of the resulting string once padded.
|
|
9
7
|
* @param {string} [chars] - The character(s) to use for padding.
|
|
@@ -16,6 +14,6 @@
|
|
|
16
14
|
* const result4 = pad('abc', 2); // result will be 'abc'
|
|
17
15
|
*
|
|
18
16
|
*/
|
|
19
|
-
declare
|
|
17
|
+
declare function pad(str: string, length: number, chars?: string): string;
|
|
20
18
|
|
|
21
19
|
export { pad };
|
package/dist/string/pad.mjs
CHANGED
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.515+959b5d08",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|