mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
24
react-app/node_modules/lodash/collection/shuffle.js
generated
vendored
Normal file
24
react-app/node_modules/lodash/collection/shuffle.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
var sample = require('./sample');
|
||||
|
||||
/** Used as references for `-Infinity` and `Infinity`. */
|
||||
var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
|
||||
|
||||
/**
|
||||
* Creates an array of shuffled values, using a version of the
|
||||
* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to shuffle.
|
||||
* @returns {Array} Returns the new shuffled array.
|
||||
* @example
|
||||
*
|
||||
* _.shuffle([1, 2, 3, 4]);
|
||||
* // => [4, 1, 3, 2]
|
||||
*/
|
||||
function shuffle(collection) {
|
||||
return sample(collection, POSITIVE_INFINITY);
|
||||
}
|
||||
|
||||
module.exports = shuffle;
|
Reference in New Issue
Block a user