ChemPare Documentation - v0.0.0
    Preparing search index...

    Function isValidProductResponse

    • Validates that a response matches the ProductResponse interface structure

      Parameters

      • obj: unknown

        Response object to validate

      Returns obj is CarolinaProductResponse

      Type predicate indicating if object is a valid ProductResponse

      const response = await this.httpGetJson({
      path: `/api/rest/cb/product/product-details/${productId}`
      });
      if (isValidProductResponse(response)) {
      // Process valid product response
      console.log(response.product.name);
      }