Minor Changes
-
#115
cb3a03eThanks @stipsan! - Accept Sanity TypeGen image types inimage()without casts, and addInferImageValue,InferStrictImageValueandisImageWithAssetfor typing shared image components.SanityImageSourcenow also acceptsSanityImageLikeandSanityImageAssetLike, which match the image shapes TypeGen generates: raw image fields, images withasset->dereferenced, partial projections likeimage{asset, crop, hotspot}andasset->{_id, url}, and custom image types with extra fields. Existing types are unchanged.Images whose dereferenced asset is
nullnow throw the usual "Unable to resolve image URL" error instead of aTypeError, and crop or hotspot objects with missing coordinates fall back to the default values instead of producingNaNin the URL.