Skip to content

Commit 5a62d5d

Browse files
authored
🐛 Test against the actual RegExp pattern (#159)
Not the whole JSON object 🙄
1 parent 0fce605 commit 5a62d5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ export default function(
4848
*/
4949
function moduleMatchesOption(module, option) {
5050
let [base] = module.split(path.sep)
51-
return [option].some((opt: string) => {
51+
return option.some((opt: string) => {
5252
let pattern = JSON.parse(`{"regex": ${JSON.stringify(opt)}}`)
53-
return RegExp(`${pattern}$`).test(base)
53+
return RegExp(`${pattern.regex}$`).test(base)
5454
})
5555
}
5656

0 commit comments

Comments
 (0)