refactor: build plugin pipeline parameters at initialization
In addition, factorize the pipeline config function to avoid code duplication.
This commit is contained in:
@@ -42,6 +42,7 @@ module.exports = (type, pluginsPath, globalOpts, pluginOpts, logger) => {
|
||||
const validator = async input => {
|
||||
const {outputValidator} = PLUGINS_DEFINITIONS[type] || {};
|
||||
try {
|
||||
logger.log('Call plugin "%s"', type);
|
||||
const result = await func(cloneDeep(input));
|
||||
if (outputValidator && !outputValidator(result)) {
|
||||
throw getError(`E${type.toUpperCase()}OUTPUT`, {result, pluginName});
|
||||
|
||||
Reference in New Issue
Block a user