@leanchuck/core - v0.1.1
    Preparing search index...

    Function pareto

    • Runs a full Pareto (80/20) analysis over a list of items.

      Steps: project each item to a number → sort descending → accumulate the cumulative share → classify each contributor as vital or trivial.

      Type Parameters

      • T

      Parameters

      • items: readonly T[]

        The contributors to analyze (e.g. customers, products, rows).

      • value: NumberAccessor<T>

        How to read the ranking number from each item.

      • Optionaloptions: ParetoOptions

        ParetoOptions controlling the split.

      Returns ParetoResult<T>

      A ParetoResult with per-item classification and totals.

      The input array is not mutated; items are copied before sorting.

      const result = pareto(customers, (c) => c.revenue);
      const topCustomers = result.items.filter((i) => i.class === 'vital');