@jplorg/jpl
Version:
JPL interpreter
24 lines (23 loc) • 628 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _utils = require("./utils");
var _default = exports.default = {
/** { name: string, pipe: [op] } */
op(runtime, input, params, scope, next) {
return runtime.executeInstructions(params.pipe ?? [], [input], scope, output => next(input, scope.next({
vars: {
[params.name ?? '']: output
}
})));
},
/** { name: string, pipe: function } */
map(runtime, params) {
return {
name: runtime.assertType(params.name, 'string'),
pipe: (0, _utils.call)(params.pipe)
};
}
};