Skip to content

Commit

Permalink
Fix format with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
prototypa committed Oct 13, 2024
1 parent eebebeb commit a5520bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/utils/images-optimization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ export const astroAsseetsOptimizer: ImagesOptimizer = async (

return Promise.all(
breakpoints.map(async (w: number) => {
const result = (await getImage({ src: image, width: w, inferSize: true, ...(format ? { format: format } : {}) }));
const result = await getImage({ src: image, width: w, inferSize: true, ...(format ? { format: format } : {}) });

return {
src: result?.src,
width: result?.attributes?.width ?? w,
height: result?.attributes?.height
height: result?.attributes?.height,
};
})
);
Expand Down
4 changes: 3 additions & 1 deletion src/utils/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export const adaptOpenGraphImages = async (
typeof resolvedImage !== 'string' && resolvedImage?.width <= defaultWidth
? [resolvedImage?.width, resolvedImage?.height]
: [defaultWidth, defaultHeight];
_image = (await astroAsseetsOptimizer(resolvedImage, [dimensions[0]], dimensions[0], dimensions[1], 'jpg'))[0];
_image = (
await astroAsseetsOptimizer(resolvedImage, [dimensions[0]], dimensions[0], dimensions[1], 'jpg')
)[0];
}

if (typeof _image === 'object') {
Expand Down

0 comments on commit a5520bb

Please sign in to comment.