Skip to content

Commit

Permalink
fix: remove eval usage so that chrome extension MV3 can run properly
Browse files Browse the repository at this point in the history
  • Loading branch information
AntiMoron committed Oct 9, 2023
1 parent 4436cc7 commit 44787a8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/inquire/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ module.exports = inquire;
* @returns {?Object} Required module if available and not empty, otherwise `null`
*/
function inquire(moduleName) {
try {
var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
if (mod && (mod.length || Object.keys(mod).length))
return mod;
} catch (e) {} // eslint-disable-line no-empty
try {
if (typeof require !== "function") {
return null;
}
var mod = require(moduleName);
if (mod && (mod.length || Object.keys(mod).length)) return mod;
return null;
} catch (err) {
// ignore
return null;
}
}

/*
Expand Down

0 comments on commit 44787a8

Please sign in to comment.