Skip to content

Commit 28f5e2b

Browse files
authored
Fix check for regex to support new Array#lastIndex proposal
Closes GH-1. Reviewed-by: Titus Wormer <tituswormer@gmail.com>
1 parent d532b4b commit 28f5e2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function findAndReplace(tree, find, replace, options) {
1414

1515
if (
1616
typeof find === 'string' ||
17-
(find && typeof find.lastIndex === 'number')
17+
(find && typeof find.exec === 'function')
1818
) {
1919
schema = [[find, replace]]
2020
} else {

0 commit comments

Comments
 (0)