@jplorg/jpl
Version:
JPL interpreter
30 lines (27 loc) • 629 B
JavaScript
import { OPM_REMAINDER, OP_CALCULATION } from '../../../library';
import { call, constant } from '../utils';
export default {
/** { pipe: [op] } */
op(runtime, input, target, params, scope, next) {
return runtime.executeInstructions(
[
{
op: OP_CALCULATION,
params: {
pipe: constant(target),
operations: [{ op: OPM_REMAINDER, params: { by: params.pipe ?? [] } }],
},
},
],
[],
scope,
next,
);
},
/** { pipe: function } */
map(runtime, params) {
return {
pipe: call(params.pipe),
};
},
};