@stencila/jesta
Version:
Stencila plugin for executable documents using JavaScript
26 lines (25 loc) • 732 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.set = exports.schema = void 0;
const session_1 = require("./util/session");
exports.schema = {
title: 'set',
description: 'Set a variable in a document.',
required: ['name', 'value'],
properties: {
name: {
description: 'The name of the variable to set.',
type: 'string',
},
value: {
description: 'The value to to set the variable to.',
},
},
};
// eslint-disable-next-line @typescript-eslint/require-await
async function set(name, value) {
session_1.session().context[name] = value;
return undefined;
}
exports.set = set;
set.schema = exports.schema;