lodash.shuffle
Advanced tools
Comparing version 3.1.0 to 4.0.0
18
index.js
/** | ||
* lodash 3.1.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modern modularize exports="npm" -o ./` | ||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
* lodash 4.0.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
*/ | ||
var sample = require('lodash.sample'); | ||
var sampleSize = require('lodash.samplesize'); | ||
/** Used as references for `-Infinity` and `Infinity`. */ | ||
var POSITIVE_INFINITY = Number.POSITIVE_INFINITY; | ||
/** Used as references for the maximum length and index of an array. */ | ||
var MAX_ARRAY_LENGTH = 4294967295; | ||
@@ -21,3 +21,3 @@ /** | ||
* @category Collection | ||
* @param {Array|Object|string} collection The collection to shuffle. | ||
* @param {Array|Object} collection The collection to shuffle. | ||
* @returns {Array} Returns the new shuffled array. | ||
@@ -30,5 +30,5 @@ * @example | ||
function shuffle(collection) { | ||
return sample(collection, POSITIVE_INFINITY); | ||
return sampleSize(collection, MAX_ARRAY_LENGTH); | ||
} | ||
module.exports = shuffle; |
{ | ||
"name": "lodash.shuffle", | ||
"version": "3.1.0", | ||
"description": "The modern build of lodash’s `_.shuffle` as a module.", | ||
"version": "4.0.0", | ||
"description": "The lodash method `_.shuffle` exported as a module.", | ||
"homepage": "https://lodash.com/", | ||
"icon": "https://lodash.com/icon.svg", | ||
"license": "MIT", | ||
"keywords": "lodash, lodash-modularized, stdlib, util", | ||
"keywords": "lodash, lodash-modularized, stdlib, util, shuffle", | ||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
"contributors": [ | ||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
"Benjamin Tan <demoneaux@gmail.com> (https://d10.github.io/)", | ||
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)", | ||
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)", | ||
"Blaine Bublitz <blaine@iceddev.com> (https://github.com/phated)", | ||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" | ||
@@ -20,4 +18,4 @@ ], | ||
"dependencies": { | ||
"lodash.sample": "^3.0.0" | ||
"lodash.samplesize": "^4.0.0" | ||
} | ||
} |
@@ -1,4 +0,4 @@ | ||
# lodash.shuffle v3.1.0 | ||
# lodash.shuffle v4.0.0 | ||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.shuffle` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. | ||
The [lodash](https://lodash.com/) method `_.shuffle` exported as a [Node.js](https://nodejs.org/) module. | ||
@@ -8,3 +8,2 @@ ## Installation | ||
Using npm: | ||
```bash | ||
@@ -15,4 +14,3 @@ $ {sudo -H} npm i -g npm | ||
In Node.js/io.js: | ||
In Node.js: | ||
```js | ||
@@ -22,2 +20,2 @@ var shuffle = require('lodash.shuffle'); | ||
See the [documentation](https://lodash.com/docs#shuffle) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.shuffle) for more details. | ||
See the [documentation](https://lodash.com/docs#shuffle) or [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash.shuffle) for more details. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3565
19
+ Addedlodash.samplesize@^4.0.0
+ Addedlodash.samplesize@4.2.0(transitive)
- Removedlodash.sample@^3.0.0
- Removedlodash._arraycopy@3.0.0(transitive)
- Removedlodash._baserandom@3.0.1(transitive)
- Removedlodash._basevalues@3.0.0(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash._isiterateecall@3.0.9(transitive)
- Removedlodash._toiterable@3.0.4(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.sample@3.1.0(transitive)
- Removedlodash.toarray@3.0.2(transitive)
- Removedlodash.values@3.0.0(transitive)