Skip to content

Commit

Permalink
[CodeFactor] Apply fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
code-factor authored and pavel-karatsiuba committed Jan 20, 2023
1 parent 5eef236 commit 459dc22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/mwoffliner.lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<any>(mw.siteInfoUrl())
const entries = body.query.general
Expand All @@ -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<string[]> {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/webpAndRedirection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)
})
}

0 comments on commit 459dc22

Please sign in to comment.