ChemPal Documentation - v1.6.0
    Preparing search index...

    Function isVWRAssetReferencesResponse

    • Type guard validating a VWR asset-references response. Requires an assetReferences array whose entries each carry a url (the assetType and language fields are tolerated).

      Parameters

      • data: unknown

        The response to validate

      Returns data is VWRAssetReferencesResponse

      Type predicate indicating whether data is a VWRAssetReferencesResponse

      isVWRAssetReferencesResponse({ assetReferences: [{ url: "https://x/coa.pdf" }] }); // true
      isVWRAssetReferencesResponse({ assetReferences: [{}] }); // false (missing url)
      export function isVWRAssetReferencesResponse(data: unknown): data is VWRAssetReferencesResponse {
      return v.safeParse(vwrAssetReferencesResponseSchema, data).success;
      }