@types/knuth-shuffle-seeded
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Installation

npm install --save @types/knuth-shuffle-seeded

Summary

This package contains type definitions for knuth-shuffle-seeded (https://github.com/TimothyGu/knuth-shuffle-seeded).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/knuth-shuffle-seeded.

index.d.ts

export = shuffle;

/**
 * Shuffle an array using the Fisher-Yates shuffle algorithm, aka Knuth
 * shuffle.
 *
 * Note that this function overwrites the initial array. As a result if you
 * would like to keep the original array intact, you have to copy the initial
 * array to a new array.
 *
 * Implementation derived from http://stackoverflow.com/questions/2450954/.
 *
 * @param inputArray - An array that is to be shuffled.
 * @param [seed=Math.random()] - Seed for the shuffling operation. If
 *                              unspecified then a random value is used.
 * @return The resulting array.
 */
declare function shuffle<T = unknown>(inputArray: T[], seed?: number): T[];

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:38 GMT
  • Dependencies: none

Credits

These definitions were written by Ethan Brown.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/knuth-shuffle-seeded

Weekly Downloads

1,149

Version

1.0.2

License

MIT

Unpacked Size

4 kB

Total Files

5

Last publish

Collaborators

  • types