/** * Sorts an array of items based on multiple fields and their specified sort order. * Uses the `fast-sort` library for efficient sorting. * @template T - The type of the items in the array. * @param items - The array of items to be sorted. * @param sortFields - An object defining the sort order for each field. * - Keys are the field names, and values are either `1` (ascending) or `-1` (descending). * @returns A new array of items sorted based on the specified fields and their order. */ export default function sortItems>(items: T[], sortFields: { [P in keyof T]?: -1 | 1; } & Record): T[];