Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bezoerb committed Nov 3, 2023
1 parent f0fd993 commit 3028586
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3028586

Please sign in to comment.