@ -1,7 +1,6 @@
|
||||
---
|
||||
import { getImage } from 'astro:assets'
|
||||
import { objectOmit } from '@dzeio/object-util'
|
||||
import AstroUtils from '../../libs/AstroUtils'
|
||||
|
||||
const formats = ['avif', 'webp']
|
||||
|
||||
@ -62,12 +61,10 @@ async function resolvePicture(image: ImageMetadata | string): Promise<PictureRes
|
||||
}
|
||||
}
|
||||
|
||||
const res = await AstroUtils.wrap<Result>(async () => {
|
||||
return {
|
||||
light: await resolvePicture(Astro.props.src),
|
||||
dark: Astro.props.srcDark ? await resolvePicture(Astro.props.srcDark) : undefined
|
||||
}
|
||||
})
|
||||
const res = {
|
||||
light: await resolvePicture(Astro.props.src),
|
||||
dark: Astro.props.srcDark ? await resolvePicture(Astro.props.srcDark) : undefined
|
||||
}
|
||||
|
||||
const props = objectOmit(Astro.props, 'src', 'srcDark', 'class')
|
||||
---
|
||||
|
Reference in New Issue
Block a user