Skip to content

Commit 0b6c336

Browse files
committed
fix: stricter regex creation
1 parent 94e15dd commit 0b6c336

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ const domLibraryAsString = readFileSync(
88
'utf8',
99
).replace(/process.env/g, '{}')
1010

11-
function mapArgument(argument: any): any {
12-
return typeof argument === 'object' && argument.regex ? new RegExp(argument.regex) : argument
11+
function mapArgument(argument: any, index: number): any {
12+
return index === 0 && typeof argument === 'object' && argument.regex
13+
? new RegExp(argument.regex)
14+
: argument
1315
}
1416

1517
const mockFnToExecuteInPage = `

0 commit comments

Comments
 (0)