From 9192c2cf3bafaa3edcb2bcb75b933b773457d274 Mon Sep 17 00:00:00 2001 From: Harelon Date: Tue, 27 Aug 2024 23:12:06 +0300 Subject: [PATCH] Check for arrays when matching regex Signed-off-by: Harelon --- src/lokijs.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lokijs.js b/src/lokijs.js index 0588569c..1bea54c0 100644 --- a/src/lokijs.js +++ b/src/lokijs.js @@ -559,6 +559,10 @@ }, $regex: function (a, b) { + if(Array.isArray(a)) + { + return a.some(item => b.test(item)); + } return b.test(a); },