diff --git a/src/Downloader.ts b/src/Downloader.ts index 7d4bbcd6c..ec5acec6c 100644 --- a/src/Downloader.ts +++ b/src/Downloader.ts @@ -373,7 +373,7 @@ class Downloader { if (json.error) { throw json.error } - return await renderArticle(json, articleId, dump, this.mwCapabilities) + return renderArticle(json, articleId, dump, this.mwCapabilities) } public async getJSON(_url: string): Promise { @@ -532,7 +532,7 @@ class Downloader { .buffer(resp.data, imageminOptions.get('webp').get(resp.headers['content-type'])) .catch(async (err) => { if (/Unsupported color conversion request/.test(err.stderr)) { - return await (imagemin as any) + return (imagemin as any) .buffer(await sharp(resp.data).toColorspace('srgb').toBuffer(), imageminOptions.get('webp').get(resp.headers['content-type'])) .catch(() => { return resp.data @@ -542,7 +542,7 @@ class Downloader { return data }) } else { - return await (imagemin as any).buffer(resp.data, imageminOptions.get('default').get(resp.headers['content-type'])).catch(() => { + return (imagemin as any).buffer(resp.data, imageminOptions.get('default').get(resp.headers['content-type'])).catch(() => { return resp.data }) } diff --git a/src/mwoffliner.lib.ts b/src/mwoffliner.lib.ts index d9b96523c..d16259416 100644 --- a/src/mwoffliner.lib.ts +++ b/src/mwoffliner.lib.ts @@ -468,7 +468,7 @@ async function execute(argv: any) { logger.log('Downloading module dependencies') await Promise.all( allDependenciesWithType.map(async ({ type, moduleList }) => { - return await pmap( + return pmap( moduleList, (oneModule) => { return downloadAndSaveModule(zimCreator, mw, downloader, dump, oneModule, type as any) @@ -535,7 +535,7 @@ async function execute(argv: any) { } if (customZimFavicon) { - return await saveFavicon(zimCreator, customZimFavicon) + return saveFavicon(zimCreator, customZimFavicon) } const body = await downloader.getJSON(mw.siteInfoUrl()) const entries = body.query.general @@ -550,7 +550,7 @@ async function execute(argv: any) { const logoUrl = parsedUrl.protocol ? entries.logo : 'http:' + entries.logo const logoContent = await downloader.downloadContent(logoUrl) await writeFilePromise(faviconPath, logoContent.content, null) - return await saveFavicon(zimCreator, faviconPath) + return saveFavicon(zimCreator, faviconPath) } async function readFileOrUrlByLine(resourcePath: string): Promise { diff --git a/test/unit/webpAndRedirection.test.ts b/test/unit/webpAndRedirection.test.ts index ba8860652..cb47fb090 100644 --- a/test/unit/webpAndRedirection.test.ts +++ b/test/unit/webpAndRedirection.test.ts @@ -60,7 +60,7 @@ Real-time computer graphics` }) async function isWebpPresent(path: string, zimFile: ZimReader) { - return await zimFile + return zimFile .getArticleByUrl(path) .then(async (result) => { return (await FileType.fileTypeFromBuffer(result.data))?.mime === 'image/webp' @@ -71,7 +71,7 @@ async function isWebpPresent(path: string, zimFile: ZimReader) { } async function isRedirectionPresent(path: string, zimFile: ZimReader) { - return await zimFile.getArticleByUrl('A/Animation').then((result) => { + return zimFile.getArticleByUrl('A/Animation').then((result) => { return result.data.toString().includes(path) }) }