Skip to content

Commit

Permalink
Check for arrays when matching regex
Browse files Browse the repository at this point in the history
Signed-off-by: Harelon <[email protected]>
  • Loading branch information
harelon committed Aug 27, 2024
1 parent 25b9a33 commit 9192c2c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lokijs.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@
},

$regex: function (a, b) {
if(Array.isArray(a))
{
return a.some(item => b.test(item));
}
return b.test(a);
},

Expand Down

0 comments on commit 9192c2c

Please sign in to comment.