MCPcopy Create free account
hub / github.com/cutedCha/noteBoook / getChapterInfo

Function getChapterInfo

js/app.js:1077–1089  ·  view source on GitHub ↗

* 获取章节信息 * @param {number} chapterNumber - 章节编号 * @returns {Object|null} 章节信息对象

(chapterNumber)

Source from the content-addressed store, hash-verified

1075 * @returns {Object|null} 章节信息对象
1076 */
1077function getChapterInfo(chapterNumber) {
1078 // 优先使用 NavigationSystem
1079 if (typeof NavigationSystem !== 'undefined' && NavigationSystem.getChapterByNumber) {
1080 return NavigationSystem.getChapterByNumber(chapterNumber);
1081 }
1082
1083 // 备用:直接从 CHAPTERS_DATA 获取
1084 if (typeof CHAPTERS_DATA !== 'undefined') {
1085 return CHAPTERS_DATA.find(ch => ch.number === chapterNumber) || null;
1086 }
1087
1088 return null;
1089}
1090
1091/**
1092 * 更新继续阅读弹窗中的章节信息

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected