ChemPal Documentation - v0.0.13-beta.5
    Preparing search index...
    • Add a product to the excluded list in IndexedDB. Idempotent: re-excluding an already-ignored product just refreshes its excludedAt and last-known title. Returns the exclusion key for the caller's logging convenience.

      Parameters

      • url: string

        Canonical product URL.

      • supplierName: string

        Supplier name.

      • Optionalmeta: { title?: string }

        Optional extra metadata (e.g. display title).

      Returns Promise<string>

      The exclusion key that was written.

      await addExcludedProduct(product.url, product.supplier, {
      title: product.title,
      });
      export async function addExcludedProduct(
      url: string,
      supplierName: string,
      meta?: { title?: string },
      ): Promise<string> {
      const key = getProductExclusionKey(url, supplierName);
      try {
      const map = await loadExcludedProducts();
      map[key] = {
      url,
      supplier: supplierName,
      title: meta?.title,
      excludedAt: Date.now(),
      };
      await putExcludedProducts(map);
      } catch (error) {
      console.warn("Failed to persist excluded product to IndexedDB:", { error });
      }
      return key;
      }