@stencila/jesta
Version:
Stencila plugin for executable documents using JavaScript
23 lines (22 loc) • 694 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.manifest = void 0;
const types_1 = require("./types");
/**
* Update the manifest for a plugin using declared schema of methods
*
* @param this The plugin instance.
*/
function manifest(base) {
const featureList = [];
for (const method of Object.keys(types_1.Method)) {
// @ts-expect-error because indexing `Jesta`
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const { schema } = this[method];
if (schema !== undefined) {
featureList.push(schema);
}
}
return { ...base, featureList };
}
exports.manifest = manifest;