ChemPal Documentation - v0.0.13-beta.5
    Preparing search index...

    Function countExcludedProductsForSupplier

    • Count how many excluded entries were ignored from a given supplier. Used by SupplierBase.execute to over-fetch from queryProducts so that dropping previously-ignored rows still leaves the caller with limit survivors instead of a short list.

      Parameters

      • supplierName: string

        Supplier name to match against entry metadata.

      Returns Promise<number>

      Count of entries whose supplier field equals supplierName.

      const extra = await countExcludedProductsForSupplier("Loudwolf");
      const results = await this.queryProductsWithCache(query, limit + extra);
      export async function countExcludedProductsForSupplier(supplierName: string): Promise<number> {
      const map = await loadExcludedProducts();
      let count = 0;
      for (const entry of Object.values(map)) {
      if (entry.supplier === supplierName) count++;
      }
      return count;
      }