From 2db8ae01c4231eff6a0d5411c9d6f0b1b871e9ef Mon Sep 17 00:00:00 2001 From: Oj Date: Mon, 7 Jun 2021 19:00:48 +0100 Subject: [PATCH] [PCCompatCheck] Add module.exports ignoring --- scripts/pccompatCheck.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/pccompatCheck.js b/scripts/pccompatCheck.js index b2ff99b..ff915a7 100644 --- a/scripts/pccompatCheck.js +++ b/scripts/pccompatCheck.js @@ -56,9 +56,10 @@ for (const jsFile of glob.sync(`${cloneDir}/**/*.js`).concat(glob.sync(`${cloneD for (let imp of imports.split(',')) { imp = imp.trim().split(':')[0]; - const searchRegex = new RegExp(`^export.*${imp}.*$`, 'gm'); + const searchRegex1 = new RegExp(`^export.*${imp}.*$`, 'gm'); + const searchRegex2 = new RegExp(`^ *${imp}: `, 'gm'); - const searchMatch = aliasJS.match(searchRegex); + const searchMatch = aliasJS.match(searchRegex1) || aliasJS.match(searchRegex2); if (!searchMatch) { if (requirePath === 'powercord/webpack') {