From 6b553eb89c1e5861449bbc14ab5528af7a9b17b8 Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Fri, 4 Nov 2022 10:49:22 +0000 Subject: [PATCH] Fix method definition --- epub.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/epub.js b/epub.js index 1c7fed5..a93d2de 100644 --- a/epub.js +++ b/epub.js @@ -703,12 +703,6 @@ export class EPUB { else this.metadata[key] = [value] })) - this.getCover = async () => { - const cover = this.resources?.cover - return cover?.href - ? new Blob([await this.loadBlob(cover.href)], { type: cover.mediaType }) - : null - } return this } async loadDocument(item) { @@ -736,6 +730,12 @@ export class EPUB { isExternal(uri) { return isExternal(uri) } + async getCover() { + const cover = this.resources?.cover + return cover?.href + ? new Blob([await this.loadBlob(cover.href)], { type: cover.mediaType }) + : null + } async getCalibreBookmarks() { const txt = await this.loadText('META-INF/calibre_bookmarks.txt') const magic = 'encoding=json+base64:'