27 lines
1021 B
JavaScript
27 lines
1021 B
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const encodeBook_1 = __importDefault(require("./encodeBook"));
|
|
/**
|
|
* Encode an output to JSON
|
|
*
|
|
* @param {Output}
|
|
* @return {Object}
|
|
*/
|
|
function encodeOutputToJson(output) {
|
|
const book = output.getBook();
|
|
const generator = output.getGenerator();
|
|
const options = output.getOptions();
|
|
const result = (0, encodeBook_1.default)(book);
|
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'output' does not exist on type '{ summar... Remove this comment to see the full error message
|
|
result.output = {
|
|
name: generator
|
|
};
|
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'options' does not exist on type '{ summa... Remove this comment to see the full error message
|
|
result.options = options.toJS();
|
|
return result;
|
|
}
|
|
exports.default = encodeOutputToJson;
|