UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

11 lines (10 loc) 371 B
/** * Turns an array of objects into a "pivot table" structure. * @author @dailker * @template T, K extends keyof T, V extends keyof T * @param {T[]} array * @param {K} key * @param {V} value * @returns {Record<string, T[V]>} */ export declare function pivot<T, K extends keyof T, V extends keyof T>(array: T[], key: K, value: V): Record<string, T[V]>;