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

    Function assertIsAmbeedProductPriceResponse

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

      Parameters

      • data: unknown

        The response data to assert

      Returns asserts data is AmbeedProductPriceResponse

      Error if the data is not a valid AmbeedProductPriceResponse

      assertIsAmbeedProductPriceResponse(response);
      // response is now typed as AmbeedProductPriceResponse
      console.log(response.value.proInfo.p_am);
      export function assertIsAmbeedProductPriceResponse(
      data: unknown,
      ): asserts data is AmbeedProductPriceResponse {
      if (!isAmbeedProductPriceResponse(data)) {
      throw new Error('assertIsAmbeedProductPriceResponse failed');
      }
      }