Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 0417c48

Browse files
author
Steffan
committed
update utils
1 parent 69bb6fd commit 0417c48

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/util.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,17 @@ export function trim(str) {
3333
return str ? str.replace(/^\s*|\s*$/g, '') : '';
3434
}
3535

36-
export function trimEnd(string, chars) {
37-
if (string && chars === undefined) {
38-
return string.replace(/\s+$/, '');
36+
export function trimEnd(str, chars) {
37+
38+
if (str && chars === undefined) {
39+
return str.replace(/\s+$/, '');
3940
}
40-
if (!string || !chars) {
41-
return string;
41+
42+
if (!str || !chars) {
43+
return str;
4244
}
43-
return string.replace(new RegExp(`[${chars}]+$`), '');
45+
46+
return str.replace(new RegExp(`[${chars}]+$`), '');
4447
}
4548

4649
export function toLower(str) {

0 commit comments

Comments
 (0)