Response object to validate
Type predicate indicating if object is a valid ATGResponse
const response = await this.httpGetJson({
path: `/api/rest/cb/product/product-quick-view/${productId}`
});
if (isATGResponse(response)) {
// Process valid ATG response
console.log(response.response.response.products[0]);
}
export function isATGResponse(obj: unknown): obj is ATGResponse {
return atgResponseSchema.safeParse(obj).success;
}
Validates that a response matches the ATGResponse interface structure.