Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
opConfig: newOpConfig = null,
executionConfig: newExConfig,
retryData = [],
clients = null,
type = 'slicer'
}) {
const {
context,
logger,
operationFn: op,
} = this;
const exConfig = executionSpec(newExConfig);
const isProcessor = op.Processor || (op.newProcessor != null);
const Schema = op.schema ? schemaShim(op).Schema : op.Schema;
const schema = new Schema(context);
let opConfig;
// This is kind of pain to deal with
// this can only work with exectionConfig
// with two operations
if (exConfig.operations.length < 2) {
opConfig = schema.validate(newOpConfig || exConfig.operations[0]);
if (isProcessor) {
exConfig.operations = [{ _op: 'test-reader' }, opConfig];
} else {
exConfig.operations = [opConfig, { _op: 'noop' }];
}
} else {
const opPosition = isProcessor ? 1 : 0;
opConfig = schema.validate(newOpConfig || exConfig.operations[opPosition]);