The parsed AJAX response to test
True when value carries a product_details HTML string
const parsed = await this.httpPostJson({ path, params, body });
if (isLeroChemVariantRefresh(parsed)) {
const dom = createDOM(parsed.product_details ?? "");
}
export function isLeroChemVariantRefresh(value: unknown): value is LeroChemVariantRefresh {
return isPopulatedObject(value) && typeof value.product_details === 'string';
}
Type guard for the PrestaShop product
refreshAJAX response. Narrows an unknown parsed value to LeroChemVariantRefresh by requiring that it be an object carrying a stringproduct_detailsHTML fragment.