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

26 lines
1.1 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 encodeBook_1 = __importDefault(require("./encodeBook"));
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 encodeBookWithPage(book, page) {
const file = page.getFile();
const result = (0, encodeBook_1.default)(book);
// @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 = encodeBookWithPage;