Skip to content

Commit

Permalink
fix: clean up undefined values
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Nov 17, 2020
1 parent 164af06 commit bf9e040
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/providers/cloudinary/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ const defaultModifiers = {
export default <RuntimeProvider> {
getImage (src: string, modifiers: ImageModifiers, options: any) {
const mergeModifiers = {
...modifiers,
format: modifiers.format || defaultModifiers.format,
quality: modifiers.quality || defaultModifiers.quality
...defaultModifiers,
...modifiers
}

const srcWithoutExtension = src.replace(/\.[^/.]+$/, '')
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ export function createImage (context, { providers, defaultProvider, presets, int
}
const { url } = image(src, {
...operations,
width: size.width,
format: size.format
width: size.width || null,
format: size.format || null
})
size.url = url
return size
Expand Down

0 comments on commit bf9e040

Please sign in to comment.