Function getFileAsset

  • Tries to resolve a (partial) file asset document with as much information as possible, from any inferrable structure (id, url, path, file object etc)

    Parameters

    • src: SanityFileSource

      Input source (file object, asset, reference, id, url, path)

    • Optionaloptions: PathBuilderOptions

      Project ID and dataset the file belongs to, along with other options

    Returns SanityFileAsset

    File asset document

    UnresolvableError Throws if passed file source could not be resolved to an asset ID