Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
obennaci committed Aug 23, 2022
1 parent ccea8a7 commit f10473b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/integrations/image/src/loaders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ export interface TransformOptions {
* TODO: DOC
* @default false
*/
withoutEnlargement: boolean;
withoutEnlargement?: boolean;

/**
* TODO: DOC
* @default false
*/
withoutReduction: boolean;
withoutReduction?: boolean;
}

export interface HostedImageService<T extends TransformOptions = TransformOptions> {
Expand Down
8 changes: 4 additions & 4 deletions packages/integrations/image/src/loaders/sharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ class SharpService implements SSRImageService {
}

if (transform.withoutEnlargement) {
searchParams.append('we', transform.withoutEnlargement);
searchParams.append('we', '1');
}

if (transform.withoutReduction) {
searchParams.append('wr', transform.withoutReduction);
searchParams.set('wr', '1');
}

searchParams.append('href', transform.src);
Expand Down Expand Up @@ -119,11 +119,11 @@ class SharpService implements SSRImageService {
}

if (searchParams.has('we')) {
transform.withoutEnlargement = Boolean(searchParams.get('we'))!;
transform.withoutEnlargement = searchParams.get('we') === '1';
}

if (searchParams.has('wr')) {
transform.withoutReduction = Boolean(searchParams.get('wr'))!;
transform.withoutReduction = searchParams.get('wr') === '1';
}

return transform;
Expand Down

0 comments on commit f10473b

Please sign in to comment.