@stencila/jesta
Version:
Stencila plugin for executable documents using JavaScript
17 lines (16 loc) • 523 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.call = void 0;
const session_1 = require("./util/session");
/**
* Call a function within a document.
*
* @param name The name of the function
* @param args Arguments to call the document or function with
*/
async function call(name, args) {
const func = session_1.session().context[name];
// @ts-expect-error TODO check args against func type signature
return (await func(...Object.values(args)));
}
exports.call = call;