1
0
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:
Nick O'Leary 2021-03-01 18:24:16 +00:00
parent d5f4f987f2
commit c3adc956d7
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 7 additions and 3 deletions

View File

@ -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) {

View File

@ -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");
}

View File

@ -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