@humanspeak/svelte-headless-table
Version:
A powerful, headless table library for Svelte that provides complete control over table UI while handling complex data operations like sorting, filtering, pagination, grouping, and row expansion. Build custom, accessible data tables with zero styling opin
14 lines (13 loc) • 466 B
TypeScript
/**
* Creates a Map that counts the occurrences of each element in an array.
*
* @template T - The type of elements in the array.
* @param items - The array of items to count.
* @returns A Map where keys are unique items and values are their occurrence counts.
* @example
* ```typescript
* getCounter(['a', 'b', 'a', 'c', 'a'])
* // Returns Map { 'a' => 3, 'b' => 1, 'c' => 1 }
* ```
*/
export declare const getCounter: <T>(items: T[]) => Map<T, number>;