The search response product to validate
Type predicate indicating if the data is a valid AmbeedSearchResponseProduct
const product = searchResults[0];
if (isAmbeedSearchResponseProduct(product)) {
console.log("Source:", product.source);
console.log("Code:", product.code);
}
export function isAmbeedSearchResponseProduct(data: unknown): data is AmbeedSearchResponseProduct {
return ambeedProductListResponseSchema.safeParse(data).success;
}
Type guard to validate if data matches the Ambeed search response product structure. Uses the same schema as the product list response for validation.