Function getAssetUrlType

  • Validates that a given URL is a Sanity asset URL, and returns the asset type if valid.

    Parameters

    • url: string

      URL to extract asset type from

    Returns "image" | "file" | false

    Asset type if valid URL, false otherwise