world/book/node_modules/honkit/lib/json/encodeOutputWithPage.js
2025-05-12 05:38:44 +09:00

27 lines
1.2 KiB
JavaScript

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const encodeOutput_1 = __importDefault(require("./encodeOutput"));
const encodePage_1 = __importDefault(require("./encodePage"));
const encodeFile_1 = __importDefault(require("./encodeFile"));
/**
* Return a JSON representation of a book with a specific file
*
* @param {Book} output
* @param {Page} page
* @return {Object}
*/
function encodeOutputWithPage(output, page) {
const file = page.getFile();
const book = output.getBook();
const result = (0, encodeOutput_1.default)(output);
// @ts-expect-error ts-migrate(2339) FIXME: Property 'page' does not exist on type '{ summary:... Remove this comment to see the full error message
result.page = (0, encodePage_1.default)(page, book.getSummary());
// @ts-expect-error ts-migrate(2339) FIXME: Property 'file' does not exist on type '{ summary:... Remove this comment to see the full error message
result.file = (0, encodeFile_1.default)(file);
return result;
}
exports.default = encodeOutputWithPage;