Comparing version 1.1.2 to 1.1.3
NoFlo ChangeLog | ||
=============== | ||
## 1.1.3 (April 12th 2018) | ||
* Fixed issue with custom component loaders on Node.js | ||
## 1.1.2 (March 24th 2018) | ||
@@ -5,0 +9,0 @@ |
@@ -1,2 +0,2 @@ | ||
var CoffeeScript, dynamicLoader, fbpGraph, fs, manifest, manifestLoader, path, registerModules, registerSubgraph, utils; | ||
var CoffeeScript, dynamicLoader, fbpGraph, fs, manifest, manifestLoader, path, registerCustomLoaders, registerModules, registerSubgraph, utils; | ||
@@ -20,4 +20,18 @@ path = require('path'); | ||
registerCustomLoaders = function(loader, componentLoaders, callback) { | ||
var customLoader; | ||
if (!componentLoaders.length) { | ||
return callback(null); | ||
} | ||
customLoader = require(componentLoaders.shift()); | ||
return loader.registerLoader(customLoader, function(err) { | ||
if (err) { | ||
return callback(err); | ||
} | ||
return registerCustomLoaders(loader, componentLoaders, callback); | ||
}); | ||
}; | ||
registerModules = function(loader, modules, callback) { | ||
var c, compatible, componentLoaders, done, i, j, len, len1, loaderPath, m, ref, ref1; | ||
var c, compatible, componentLoaders, i, j, len, len1, loaderPath, m, ref, ref1; | ||
compatible = modules.filter(function(m) { | ||
@@ -43,20 +57,3 @@ var ref; | ||
} | ||
if (!componentLoaders.length) { | ||
return callback(null); | ||
} | ||
done = function() { | ||
if (--componentLoaders.length < 1) { | ||
return callback.apply(this, arguments); | ||
} | ||
}; | ||
return componentLoaders.forEach((loaderPath) => { | ||
var cLoader; | ||
cLoader = require(loaderPath); | ||
return loader.registerLoader(cLoader, function(err) { | ||
if (err) { | ||
return callback(err); | ||
} | ||
return done(null); | ||
}); | ||
}); | ||
return registerCustomLoaders(loader, componentLoaders, callback); | ||
}; | ||
@@ -63,0 +60,0 @@ |
@@ -11,3 +11,3 @@ { | ||
"author": "Henri Bergius <henri.bergius@iki.fi>", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"license": "MIT", | ||
@@ -14,0 +14,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
691335
5897