Skip to content

Commit

Permalink
feat: give a real type to the default image loader
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhhashemi committed Oct 22, 2022
1 parent 7796b1e commit b634a78
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/next/shared/lib/image-loader.ts
@@ -1,5 +1,13 @@
// TODO: change "any" to actual type
function defaultLoader({ config, src, width, quality }: any): string {
import { ImageConfigComplete } from './image-config'

type DefaultLoaderData = {
config: ImageConfigComplete
src: string
width: number
quality?: number
}

function defaultLoader({ config, src, width, quality }: DefaultLoaderData): string {
if (process.env.NODE_ENV !== 'production') {
const missingValues = []

Expand Down

0 comments on commit b634a78

Please sign in to comment.