Skip to content
This repository was archived by the owner on May 30, 2022. It is now read-only.

Commit f2f9df1

Browse files
author
Luis Flores
authored
Merge pull request #12 from JonFridrik/master
fix(regex): Reset regex last index
2 parents 9124a31 + af316dc commit f2f9df1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ const evaluateExpression = (expression, path, scheme) => {
4545
}
4646

4747
try {
48-
const match = expression.exec(path);
48+
const regex = expression;
49+
const match = regex.exec(path);
50+
regex.lastIndex = 0;
4951
if (match) {
5052
return { scheme, path, match };
5153
}

0 commit comments

Comments
 (0)