From 5d3c426a078bc939712ad9a1362f56cc6b313621 Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Sep 2022 10:07:30 +0200 Subject: [PATCH] fix: NextJS 12 Error --- 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)