UNPKG

typedash

Version:

modern, type-safe collection of utility functions

20 lines (19 loc) 626 B
import { t as Maybe } from "./Maybe-pvX1mStM.js"; //#region src/functions/shuffle/shuffle.d.ts /** * Returns a new array with elements randomly reordered using the Fisher-Yates algorithm. * Does not mutate the input array. * @param array The array to shuffle. * @returns A new array with the same elements in a random order. * @example * ```ts * shuffle([1, 2, 3, 4]) // e.g. [3, 1, 4, 2] * shuffle([]) // [] * shuffle(null) // [] * shuffle(undefined) // [] * ``` */ declare function shuffle<T>(array: Maybe<readonly T[]>): T[]; //#endregion export { shuffle as t }; //# sourceMappingURL=shuffle-DQW5rLB6.d.ts.map