Skip to content

Commit

Permalink
fix: remove eval usage so that chrome extension MV3 can run properly (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
AntiMoron authored Dec 30, 2024
1 parent 547afa2 commit f2ccb99
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 f2ccb99

Please sign in to comment.