lodash.intersection
Advanced tools
Comparing version 3.0.3 to 3.1.0
70
index.js
/** | ||
* lodash 3.0.3 (Custom Build) <https://lodash.com/> | ||
* lodash 3.1.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modern modularize exports="npm" -o ./` | ||
@@ -11,14 +11,64 @@ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
cacheIndexOf = require('lodash._cacheindexof'), | ||
createCache = require('lodash._createcache'), | ||
isArguments = require('lodash.isarguments'), | ||
isArray = require('lodash.isarray'); | ||
createCache = require('lodash._createcache'); | ||
/** | ||
* Creates an array of unique values in all provided arrays using `SameValueZero` | ||
* Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) | ||
* of an array-like value. | ||
*/ | ||
var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; | ||
/** | ||
* The base implementation of `_.property` without support for deep paths. | ||
* | ||
* @private | ||
* @param {string} key The key of the property to get. | ||
* @returns {Function} Returns the new function. | ||
*/ | ||
function baseProperty(key) { | ||
return function(object) { | ||
return object == null ? undefined : object[key]; | ||
}; | ||
} | ||
/** | ||
* Gets the "length" property value of `object`. | ||
* | ||
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) | ||
* that affects Safari on at least iOS 8.1-8.3 ARM64. | ||
* | ||
* @private | ||
* @param {Object} object The object to query. | ||
* @returns {*} Returns the "length" value. | ||
*/ | ||
var getLength = baseProperty('length'); | ||
/** | ||
* Checks if `value` is array-like. | ||
* | ||
* @private | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is array-like, else `false`. | ||
*/ | ||
function isArrayLike(value) { | ||
return value != null && isLength(getLength(value)); | ||
} | ||
/** | ||
* Checks if `value` is a valid array-like length. | ||
* | ||
* **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). | ||
* | ||
* @private | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`. | ||
*/ | ||
function isLength(value) { | ||
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; | ||
} | ||
/** | ||
* Creates an array of unique values in all provided arrays using | ||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* for equality comparisons. | ||
* | ||
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* comparisons are like strict equality comparisons, e.g. `===`, except that | ||
* `NaN` matches `NaN`. | ||
* | ||
* @static | ||
@@ -44,3 +94,3 @@ * @memberOf _ | ||
var value = arguments[argsIndex]; | ||
if (isArray(value) || isArguments(value)) { | ||
if (isArrayLike(value)) { | ||
args.push(value); | ||
@@ -47,0 +97,0 @@ caches.push((isCommon && value.length >= 120) ? createCache(argsIndex && value) : null); |
{ | ||
"name": "lodash.intersection", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"description": "The modern build of lodash’s `_.intersection` as a module.", | ||
@@ -22,6 +22,4 @@ "homepage": "https://lodash.com/", | ||
"lodash._cacheindexof": "^3.0.0", | ||
"lodash._createcache": "^3.0.0", | ||
"lodash.isarguments": "^3.0.0", | ||
"lodash.isarray": "^3.0.0" | ||
"lodash._createcache": "^3.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash.intersection v3.0.3 | ||
# lodash.intersection v3.1.0 | ||
@@ -20,2 +20,2 @@ 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. | ||
See the [documentation](https://lodash.com/docs#intersection) or [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash.intersection) for more details. | ||
See the [documentation](https://lodash.com/docs#intersection) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.intersection) for more details. |
6573
3
118
- Removedlodash.isarguments@^3.0.0
- Removedlodash.isarray@^3.0.0
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)