From 2ce6fd8cf1c4b898fee58ca781d67feebce83e89 Mon Sep 17 00:00:00 2001 From: Jamal Youssefi Date: Tue, 31 Oct 2023 17:26:52 +0100 Subject: [PATCH] fix: regex --- src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 431d4ea..e25245a 100644 --- a/src/utils.js +++ b/src/utils.js @@ -55,7 +55,7 @@ function findHandler( isBodyOrParametersMatching(method, body, parameters, handler[1]) && isObjectMatching(headers, handler[2]) ); - } else if (handler[0] instanceof RegExp) { + } else if (typeof handler[0] === 'object' && handler[0].constructor.name === "RegExp") { return ( (handler[0].test(url) || handler[0].test(combineUrls(baseURL, url))) && isBodyOrParametersMatching(method, body, parameters, handler[1]) &&