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

    Function assertIsAmbeedGetSearchProductAndRecommendedProductsByCASResponse

    • Type assertion to ensure the given data is a valid AmbeedGetSearchProductAndRecommendedProductsByCASResponse. Throws an error if the data does not match the expected structure.

      Parameters

      • data: unknown

        The response data to assert

      Returns asserts data is AmbeedGetSearchProductAndRecommendedProductsByCASResponse

      Error if the data is not a valid AmbeedGetSearchProductAndRecommendedProductsByCASResponse

      assertIsAmbeedGetSearchProductAndRecommendedProductsByCASResponse(response);
      // response is now typed as AmbeedGetSearchProductAndRecommendedProductsByCASResponse
      console.log(response.value.search_pro_dict.p_cas);
      export function assertIsAmbeedGetSearchProductAndRecommendedProductsByCASResponse(
      data: unknown,
      ): asserts data is AmbeedGetSearchProductAndRecommendedProductsByCASResponse {
      if (!isAmbeedGetSearchProductAndRecommendedProductsByCASResponse(data)) {
      throw new Error('assertIsAmbeedGetSearchProductAndRecommendedProductsByCASResponse failed');
      }
      }