Skip to content

Commit 261163d

Browse files
authored
fix: useless regular-expression character escape (#64)
<!-- ps-id: 45e5899a-4c3f-41dd-a9fa-969d5aa27490 -->
1 parent c5407de commit 261163d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/strings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const trimLeft = (subject: string, chars?: string): string => {
6969
return trimImpl(subject, list => new RegExp(`^[${list}]*(.*?)`), chars);
7070
};
7171
export const trimRight = (subject: string, chars?: string): string => {
72-
return trimImpl(subject, list => new RegExp(`(.*?)[${list}]*\$`), chars);
72+
return trimImpl(subject, list => new RegExp(`(.*?)[${list}]*$`), chars);
7373
};
7474
const trimImpl = (subject: string, regExper: (arg: string) => RegExp, chars?: string): string => {
7575
const pattern = chars ? chars.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&') : '\\s\u0085';

0 commit comments

Comments
 (0)