From f5ed7ce221b511f67bded1d944aa98c494642e38 Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Sep 2022 10:09:24 +0200 Subject: [PATCH] fix: NextJS 12 Error (#1) --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index e050d91..5e77661 100644 --- a/index.js +++ b/index.js @@ -27,6 +27,7 @@ const ammendOneOfRules = config => (a, c) => { && c.test.source const matchesRegExpIssuer = 'issuer' in c + && typeof c.issuer !== 'undefined' && c.issuer instanceof RegExp && c.issuer.source @@ -43,12 +44,14 @@ const ammendOneOfRules = config => (a, c) => { || (() => false)) const issuerAccepts = ('issuer' in c + && typeof c.issuer !== 'undefined' && 'and' in c.issuer && Array.isArray(c.issuer.and) && matchArray(c.issuer.and) || (() => false)) const issuerAvoids = ('issuer' in c + && typeof c.issuer !== 'undefined' && 'not' in c.issuer && Array.isArray(c.issuer.not) && matchArray(c.issuer.not)