mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Rework Function node module integration
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
const path = require("path");
|
||||
const semver = require("semver");
|
||||
const {events,i18n,log} = require("@node-red/util");
|
||||
|
||||
var runtime;
|
||||
|
||||
function copyObjectProperties(src,dst,copyList,blockList) {
|
||||
@@ -45,13 +46,8 @@ function requireModule(name) {
|
||||
var relPath = path.relative(__dirname, moduleInfo.path);
|
||||
return require(relPath);
|
||||
} else {
|
||||
var npm = runtime.nodes.loadNPMModule(name);
|
||||
if (npm) {
|
||||
return npm;
|
||||
}
|
||||
var err = new Error(`Cannot find module '${name}'`);
|
||||
err.code = "MODULE_NOT_FOUND";
|
||||
throw err;
|
||||
// Require it here to avoid the circular dependency
|
||||
return require("./externalModules").require(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +125,6 @@ function checkAgainstList(module,version,list) {
|
||||
}
|
||||
|
||||
function checkModuleAllowed(module,version,allowList,denyList) {
|
||||
// console.log("checkModuleAllowed",module,version);//,allowList,denyList)
|
||||
if (!allowList && !denyList) {
|
||||
// Default to allow
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user