@jplorg/jpl
Version:
JPL interpreter
35 lines (33 loc) • 750 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.call = call;
exports.constant = constant;
var _library = require("../../library");
/** Create OP_CONSTANT operation for the specified normalized value */
function constant(value) {
return [{
op: _library.OP_CONSTANT,
params: {
value: value ?? null
}
}];
}
/** Create OPA_FUNCTION operation for the specified function */
function call(value) {
return [{
op: _library.OP_ACCESS,
params: {
pipe: constant((0, _library.assertType)(value, 'function')),
selectors: [{
op: _library.OPA_FUNCTION,
params: {
args: [],
bound: false,
optional: false
}
}]
}
}];
}