mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add functionExternalModules to settings and default to false
This commit is contained in:
parent
d5f4f987f2
commit
c3adc956d7
@ -523,7 +523,7 @@
|
||||
|
||||
$("#node-input-noerr").val(noerr);
|
||||
this.noerr = noerr;
|
||||
if (RED.settings.functionExternalModules !== false) {
|
||||
if (RED.settings.functionExternalModules === true) {
|
||||
var libs = $("#node-input-libs-container").editableList("items");
|
||||
node.libs = [];
|
||||
libs.each(function(i) {
|
||||
|
@ -97,7 +97,7 @@ module.exports = function(RED) {
|
||||
node.fin = n.finalize ? n.finalize.trim() : "";
|
||||
node.libs = n.libs || [];
|
||||
|
||||
if (RED.settings.functionExternalModules === false && node.libs.length > 0) {
|
||||
if (RED.settings.functionExternalModules !== true && node.libs.length > 0) {
|
||||
throw new Error("Function node not allowed to load external modules");
|
||||
}
|
||||
|
||||
|
4
packages/node_modules/node-red/settings.js
vendored
4
packages/node_modules/node-red/settings.js
vendored
@ -243,6 +243,10 @@ module.exports = {
|
||||
// jfive:require("johnny-five"),
|
||||
// j5board:require("johnny-five").Board({repl:false})
|
||||
},
|
||||
|
||||
// Allow the Function node to load additional npm modules
|
||||
functionExternalModules: false,
|
||||
|
||||
// `global.keys()` returns a list of all properties set in global context.
|
||||
// This allows them to be displayed in the Context Sidebar within the editor.
|
||||
// In some circumstances it is not desirable to expose them to the editor. The
|
||||
|
Loading…
Reference in New Issue
Block a user