UNPKG

@rudderstack/workflow-engine

Version:
22 lines 902 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FunctionStepExecutor = void 0; const errors_1 = require("../../../../errors"); const base_1 = require("../../executors/base"); class FunctionStepExecutor extends base_1.BaseStepExecutor { constructor(step, bindings) { super(step); this.fn = FunctionStepExecutor.extractFunction(step.functionName, bindings, step.name); } static extractFunction(functionName, bindings, stepName) { if (typeof bindings[functionName] !== 'function') { throw new errors_1.StepCreationError(`Invalid functionName: ${functionName}`, stepName); } return bindings[functionName]; } async execute(input, executionBindings) { return this.fn(input, executionBindings); } } exports.FunctionStepExecutor = FunctionStepExecutor; //# sourceMappingURL=function.js.map