Skip to content

Commit

Permalink
fix: isFilled.image() parameter type (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: lihbr <lihbr@users.noreply.github.com>
Co-authored-by: Angelo Ashmore <angeloashmore@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 18, 2022
1 parent 1305d40 commit 8d99482
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/isFilled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const title = richText as (
/**
* Determines if an Image thumbnail is filled.
*
* @param field - Image thumbnail to check.
* @param thumbnail - Image thumbnail to check.
*
* @returns `true` if `field` is filled, `false` otherwise.
*/
Expand All @@ -97,8 +97,14 @@ export const imageThumbnail = (
*
* @returns `true` if `field` is filled, `false` otherwise.
*/
export const image = imageThumbnail as <ThumbnailNames extends string | null>(
field: ImageField<ThumbnailNames> | null | undefined,
export const image = imageThumbnail as <
Field extends ImageField,
ThumbnailNames extends Exclude<
keyof Field,
keyof ImageFieldImage | number | symbol
>,
>(
field: Field | ImageField<ThumbnailNames> | null | undefined,
) => field is ImageField<ThumbnailNames, "filled">;

/**
Expand Down

0 comments on commit 8d99482

Please sign in to comment.