ChemPal Documentation - v1.6.0
    Preparing search index...

    Function isLeroChemVariantRefresh

    • Type guard for the PrestaShop product refresh AJAX response. Narrows an unknown parsed value to LeroChemVariantRefresh by requiring that it be an object carrying a string product_details HTML fragment.

      Parameters

      • value: unknown

        The parsed AJAX response to test

      Returns value is LeroChemVariantRefresh

      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';
      }