@polgubau/utils
Version:
A collection of utility functions for TypeScript
14 lines (12 loc) • 405 B
text/typescript
/**
* Limit array to a certain number of elements and return the remaining count.
* It is useful for displaying the first few elements and showing the remaining count.
* @param arr <T>[]
* @param limit number
* @returns { limitedArray: T[], remaining: number }
*/
declare const limitArray: <T>(arr: T[], limit?: number) => {
limitedArray: T[];
remaining: number;
};
export { limitArray };