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

    Function isVWRTokenResponse

    • Type guard validating a VWR OAuth token response. Requires a bearer access_token, a token_type, and a numeric expires_in lifetime.

      Parameters

      • data: unknown

        The response to validate

      Returns data is VWRTokenResponse

      Type predicate indicating whether data is a VWRTokenResponse

      isVWRTokenResponse({ access_token: "abc", token_type: "bearer", expires_in: 39047 }); // true
      isVWRTokenResponse({ token_type: "bearer" }); // false
      export function isVWRTokenResponse(data: unknown): data is VWRTokenResponse {
      return v.safeParse(vwrTokenResponseSchema, data).success;
      }