Skip to content

Commit eeef58c

Browse files
committed
do not use named capture groups
1 parent 0396961 commit eeef58c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export default function parse(expression: string): Options {
1818
if (/to|in|as/i.exec(expression)) {
1919
const firstPart = expression.slice(0, expression.search(/to|in|as/i)).toUpperCase().trim();
2020

21-
from = firstPart.replace(/(?<currency_code>[^A-Za-z])/g, '');
21+
from = firstPart.replace(/[^A-Za-z]/g, '');
2222
to = expression.slice(expression.search(/to|in|as/i) + 2).toUpperCase().trim();
2323
} else {
24-
from = expression.replace(/(?<currency_code>[^A-Za-z])/g, '');
24+
from = expression.replace(/[^A-Za-z]/g, '');
2525
}
2626

2727
if (amount === undefined) {

0 commit comments

Comments
 (0)