Skip to content

Commit

Permalink
fix: remove duplicate conditional statement
Browse files Browse the repository at this point in the history
+ Remove duplicate `typeof image` condition from the `getSanityRefId` fn
  • Loading branch information
breadadams authored and lorenzodejong committed May 8, 2023
1 parent d167870 commit e1eb37f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/useNextSanityImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ function getSanityRefId(image: SanityImageSource): string {
const ref = image as SanityReference;
const img = image as SanityAsset;

if (typeof image === 'string') {
return image;
}

if (obj.asset) {
return obj.asset._ref || (obj.asset as SanityAsset)._id;
}
Expand Down

0 comments on commit e1eb37f

Please sign in to comment.