From 3028586f3f938be99b970cabd4c7bcee23949239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Z=C3=B6rb?= Date: Fri, 3 Nov 2023 08:50:57 +0100 Subject: [PATCH] lint --- lib/image.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/image.js b/lib/image.js index 09aea7a..07ca0f4 100644 --- a/lib/image.js +++ b/lib/image.js @@ -27,7 +27,6 @@ function encodeSvg(content) { ); } - async function assertSize(resource, maxFileSize, throwError = true) { const {mime, contents = ''} = resource || {}; const encoding = mime === 'image/svg+xml' ? 'utf-8' : 'binary'; @@ -76,12 +75,15 @@ async function getDataUriMapping(urls = [], options = {}) { const file = await resolve(url, options); if (file && file.mime && /image/.test(file.mime)) { return [url, await getDataUri(file, options)]; - } else if (options.largeFileCallback) { + } + + if (options.largeFileCallback) { const largeFile = await resolve(url, {...options, maxFileSize: 0}); if (largeFile && largeFile.mime && /image/.test(largeFile.mime)) { return [url, await options.largeFileCallback(largeFile)]; } } + return [url, null]; }); const results = await Promise.all(promises);