Fix format with prettier
This commit is contained in:
@@ -225,12 +225,12 @@ export const astroAsseetsOptimizer: ImagesOptimizer = async (
|
|||||||
|
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
breakpoints.map(async (w: number) => {
|
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 {
|
return {
|
||||||
src: result?.src,
|
src: result?.src,
|
||||||
width: result?.attributes?.width ?? w,
|
width: result?.attributes?.width ?? w,
|
||||||
height: result?.attributes?.height
|
height: result?.attributes?.height,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@@ -84,7 +84,9 @@ export const adaptOpenGraphImages = async (
|
|||||||
typeof resolvedImage !== 'string' && resolvedImage?.width <= defaultWidth
|
typeof resolvedImage !== 'string' && resolvedImage?.width <= defaultWidth
|
||||||
? [resolvedImage?.width, resolvedImage?.height]
|
? [resolvedImage?.width, resolvedImage?.height]
|
||||||
: [defaultWidth, defaultHeight];
|
: [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') {
|
if (typeof _image === 'object') {
|
||||||
|
Reference in New Issue
Block a user