Merge pull request #9 from CobyPear/feature/default-crop-for-fixed-size

Set default crop option when using only height and width
This commit is contained in:
Nicco 2021-11-07 17:14:00 +01:00 committed by GitHub
commit 11654826e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,6 +65,7 @@ export function image(node: HTMLImageElement, parameters: ImageParameters) {
let { src, options, bind, lazy, step } = parameters
log('Image Declared', parameters)
options = options ?? {}
options.crop = options.crop ?? 'fill'
step = step ?? 200
lazy = lazy ?? true