Skip to content

Commit

Permalink
fix: merge merge presets with inline modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Nov 17, 2020
1 parent 0856343 commit 164af06
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/runtime/image.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import defu from 'defu'
import type { CreateImageOptions, ImageModifiers, ImagePreset, ImageSize } from 'types'
import { getMeta } from './meta'
import { cleanDoubleSlashes, isRemoteUrl } from './utils'
Expand Down Expand Up @@ -77,7 +78,7 @@ export function createImage (context, { providers, defaultProvider, presets, int

const image = provider.provider.getImage(
src,
preset ? preset.modifiers : modifiers,
defu(modifiers, preset.modifiers),
{ ...provider.defaults, ...options }
)

Expand Down
6 changes: 3 additions & 3 deletions src/runtime/nuxt-img.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export default {
},
format: {
type: String,
default: undefined
default: null
},
quality: {
type: [Number, String],
default: 75
default: null
},
fit: {
type: String,
default: 'cover'
default: null
},
operations: {
type: Object,
Expand Down
8 changes: 4 additions & 4 deletions src/runtime/nuxt-picture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ export default {
},
format: {
type: String,
default: undefined
default: null
},
fallbackFormat: {
type: String,
default: undefined
default: null
},
quality: {
type: [Number, String],
default: 75
default: null
},
fit: {
type: String,
default: 'cover'
default: null
},
operations: {
type: Object,
Expand Down

0 comments on commit 164af06

Please sign in to comment.