fix
This commit is contained in:
21
book/node_modules/honkit/lib/modifiers/summary/editPartTitle.js
generated
vendored
Normal file
21
book/node_modules/honkit/lib/modifiers/summary/editPartTitle.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
/**
|
||||
Edit title of a part in the summary
|
||||
|
||||
@param {Summary} summary
|
||||
@param {number} index
|
||||
@param {string} newTitle
|
||||
@return {Summary}
|
||||
*/
|
||||
function editPartTitle(summary, index, newTitle) {
|
||||
let parts = summary.getParts();
|
||||
let part = parts.get(index);
|
||||
if (!part) {
|
||||
return summary;
|
||||
}
|
||||
part = part.set("title", newTitle);
|
||||
parts = parts.set(index, part);
|
||||
return summary.set("parts", parts);
|
||||
}
|
||||
exports.default = editPartTitle;
|
Reference in New Issue
Block a user