mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
Update ESLint to 3.0.0. This includes an enhancement to `no-unused-vars` such that it finds a few instances in our code base that it did not find previously (fixed in previous commits readying this for landing). PR-URL: https://github.com/nodejs/node/pull/7601 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
32 lines
996 B
JavaScript
32 lines
996 B
JavaScript
var baseDifference = require('./_baseDifference'),
|
|
baseFlatten = require('./_baseFlatten'),
|
|
isArrayLikeObject = require('./isArrayLikeObject'),
|
|
rest = require('./rest');
|
|
|
|
/**
|
|
* Creates an array of unique `array` values not included in the other given
|
|
* arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
|
* for equality comparisons. The order of result values is determined by the
|
|
* order they occur in the first array.
|
|
*
|
|
* @static
|
|
* @memberOf _
|
|
* @since 0.1.0
|
|
* @category Array
|
|
* @param {Array} array The array to inspect.
|
|
* @param {...Array} [values] The values to exclude.
|
|
* @returns {Array} Returns the new array of filtered values.
|
|
* @see _.without, _.xor
|
|
* @example
|
|
*
|
|
* _.difference([2, 1], [2, 3]);
|
|
* // => [1]
|
|
*/
|
|
var difference = rest(function(array, values) {
|
|
return isArrayLikeObject(array)
|
|
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
|
|
: [];
|
|
});
|
|
|
|
module.exports = difference;
|