The value to validate
Type predicate indicating whether response is an EpagesProductPage
const json = await httpGetJson({ path: variation.link.href });
if (isEpagesProductPage(json) && json.forSale) {
console.log(json.priceInfo?.price?.amount);
}
export function isEpagesProductPage(response: unknown): response is EpagesProductPage {
return v.safeParse(epagesProductPageSchema, response).success;
}
Type guard for a per-variation (or master) product page (
GET …/products/{id}). Verifies the fields the enrichment step reads first —productIdand theforSalestock flag.