lodash.intersection
Advanced tools
Comparing version 2.4.1 to 3.0.0
63
index.js
/** | ||
* Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> | ||
* Build: `lodash modularize modern exports="npm" -o ./npm/` | ||
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> | ||
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <http://lodash.com/license> | ||
* lodash 3.0.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modern modularize exports="npm" -o ./` | ||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
* Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
*/ | ||
@@ -12,18 +12,19 @@ var baseIndexOf = require('lodash._baseindexof'), | ||
createCache = require('lodash._createcache'), | ||
getArray = require('lodash._getarray'), | ||
isArguments = require('lodash.isarguments'), | ||
isArray = require('lodash.isarray'), | ||
largeArraySize = require('lodash._largearraysize'), | ||
releaseArray = require('lodash._releasearray'), | ||
releaseObject = require('lodash._releaseobject'); | ||
isArray = require('lodash.isarray'); | ||
/** | ||
* Creates an array of unique values present in all provided arrays using | ||
* strict equality for comparisons, i.e. `===`. | ||
* Creates an array of unique values in all provided arrays using `SameValueZero` | ||
* for equality comparisons. | ||
* | ||
* **Note:** `SameValueZero` comparisons are like strict equality comparisons, | ||
* e.g. `===`, except that `NaN` matches `NaN`. See the | ||
* [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* for more details. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Arrays | ||
* @param {...Array} [array] The arrays to inspect. | ||
* @returns {Array} Returns an array of shared values. | ||
* @category Array | ||
* @param {...Array} [arrays] The arrays to inspect. | ||
* @returns {Array} Returns the new array of shared values. | ||
* @example | ||
@@ -38,6 +39,5 @@ * | ||
argsLength = arguments.length, | ||
caches = getArray(), | ||
caches = [], | ||
indexOf = baseIndexOf, | ||
trustIndexOf = indexOf === baseIndexOf, | ||
seen = getArray(); | ||
isCommon = true; | ||
@@ -48,21 +48,19 @@ while (++argsIndex < argsLength) { | ||
args.push(value); | ||
caches.push(trustIndexOf && value.length >= largeArraySize && | ||
createCache(argsIndex ? args[argsIndex] : seen)); | ||
caches.push(isCommon && value.length >= 120 && createCache(argsIndex && value)); | ||
} | ||
} | ||
argsLength = args.length; | ||
var array = args[0], | ||
index = -1, | ||
length = array ? array.length : 0, | ||
result = []; | ||
result = [], | ||
seen = caches[0]; | ||
outer: | ||
while (++index < length) { | ||
var cache = caches[0]; | ||
value = array[index]; | ||
if ((cache ? cacheIndexOf(cache, value) : indexOf(seen, value)) < 0) { | ||
if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value)) < 0) { | ||
argsIndex = argsLength; | ||
(cache || seen).push(value); | ||
while (--argsIndex) { | ||
cache = caches[argsIndex]; | ||
var cache = caches[argsIndex]; | ||
if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) { | ||
@@ -72,13 +70,8 @@ continue outer; | ||
} | ||
if (seen) { | ||
seen.push(value); | ||
} | ||
result.push(value); | ||
} | ||
} | ||
while (argsLength--) { | ||
cache = caches[argsLength]; | ||
if (cache) { | ||
releaseObject(cache); | ||
} | ||
} | ||
releaseArray(caches); | ||
releaseArray(seen); | ||
return result; | ||
@@ -85,0 +78,0 @@ } |
@@ -1,3 +0,3 @@ | ||
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> | ||
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, | ||
Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, | ||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> | ||
@@ -22,2 +22,2 @@ | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
{ | ||
"name": "lodash.intersection", | ||
"version": "2.4.1", | ||
"description": "The Lo-Dash function `_.intersection` as a Node.js module generated by lodash-cli.", | ||
"homepage": "http://lodash.com/custom-builds", | ||
"version": "3.0.0", | ||
"description": "The modern build of lodash’s `_.intersection` as a module.", | ||
"homepage": "https://lodash.com/", | ||
"icon": "https://lodash.com/icon.svg", | ||
"license": "MIT", | ||
"keywords": ["functional", "lodash", "lodash-modularized", "server", "util"], | ||
"keywords": "lodash, lodash-modularized, stdlib, util", | ||
"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/)", | ||
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)" | ||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" | ||
], | ||
"bugs": "https://github.com/lodash/lodash-cli/issues", | ||
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" }, | ||
"repository": "lodash/lodash", | ||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, | ||
"dependencies": { | ||
"lodash._baseindexof": "~2.4.1", | ||
"lodash._cacheindexof": "~2.4.1", | ||
"lodash._createcache": "~2.4.1", | ||
"lodash._getarray": "~2.4.1", | ||
"lodash.isarguments": "~2.4.1", | ||
"lodash.isarray": "~2.4.1", | ||
"lodash._largearraysize": "~2.4.1", | ||
"lodash._releasearray": "~2.4.1", | ||
"lodash._releaseobject": "~2.4.1" | ||
"lodash._baseindexof": "^3.0.0", | ||
"lodash._cacheindexof": "^3.0.0", | ||
"lodash._createcache": "^3.0.0", | ||
"lodash.isarguments": "^3.0.0", | ||
"lodash.isarray": "^3.0.0" | ||
} | ||
} |
@@ -1,15 +0,20 @@ | ||
# lodash.intersection v2.4.1 | ||
# lodash.intersection v3.0.0 | ||
The [Lo-Dash](http://lodash.com/) function [`_.intersection`](http://lodash.com/docs#intersection) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). | ||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.intersection` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. | ||
## Author | ||
## Installation | ||
| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | | ||
|---| | ||
| [John-David Dalton](http://allyoucanleet.com/) | | ||
Using npm: | ||
## Contributors | ||
```bash | ||
$ {sudo -H} npm i -g npm | ||
$ npm i --save lodash.intersection | ||
``` | ||
| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | | ||
|---|---|---| | ||
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | | ||
In Node.js/io.js: | ||
```js | ||
var intersection = require('lodash.intersection'); | ||
``` | ||
See the [documentation](https://lodash.com/docs#intersection) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.intersection) 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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
5
21
5288
72
1
+ Addedlodash._baseindexof@3.1.0(transitive)
+ Addedlodash._cacheindexof@3.0.2(transitive)
+ Addedlodash._createcache@3.1.2(transitive)
+ Addedlodash._getnative@3.9.1(transitive)
+ Addedlodash.isarguments@3.1.0(transitive)
+ Addedlodash.isarray@3.0.4(transitive)
- Removedlodash._getarray@~2.4.1
- Removedlodash._largearraysize@~2.4.1
- Removedlodash._releasearray@~2.4.1
- Removedlodash._releaseobject@~2.4.1
- Removedlodash._arraypool@2.4.1(transitive)
- Removedlodash._baseindexof@2.4.1(transitive)
- Removedlodash._cacheindexof@2.4.1(transitive)
- Removedlodash._cachepush@2.4.1(transitive)
- Removedlodash._createcache@2.4.1(transitive)
- Removedlodash._getarray@2.4.1(transitive)
- Removedlodash._getobject@2.4.1(transitive)
- Removedlodash._isnative@2.4.1(transitive)
- Removedlodash._keyprefix@2.4.2(transitive)
- Removedlodash._largearraysize@2.4.1(transitive)
- Removedlodash._maxpoolsize@2.4.1(transitive)
- Removedlodash._objectpool@2.4.1(transitive)
- Removedlodash._releasearray@2.4.1(transitive)
- Removedlodash._releaseobject@2.4.1(transitive)
- Removedlodash.isarguments@2.4.1(transitive)
- Removedlodash.isarray@2.4.1(transitive)
Updatedlodash._baseindexof@^3.0.0
Updatedlodash._cacheindexof@^3.0.0
Updatedlodash._createcache@^3.0.0
Updatedlodash.isarguments@^3.0.0
Updatedlodash.isarray@^3.0.0