UNPKG

@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

27 lines (26 loc) 889 B
/** * Returns an array containing only the distinct elements from the input array. * Preserves the order of first occurrence. * * @template T - The type of elements in the array. * @param items - The input array potentially containing duplicates. * @returns A new array with duplicate elements removed. * @example * ```typescript * getDistinct([1, 2, 2, 3, 1]) // Returns [1, 2, 3] * ``` */ export declare const getDistinct: <T>(items: T[]) => T[]; /** * Returns an array containing only the elements that appear more than once * in the input array. * * @template T - The type of elements in the array. * @param items - The input array to check for duplicates. * @returns A new array containing only duplicate elements. * @example * ```typescript * getDuplicates([1, 2, 2, 3, 1]) // Returns [1, 2] * ``` */ export declare const getDuplicates: <T>(items: T[]) => T[];