mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Bump to v4.0.0.
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
/**
|
||||
* lodash 3.0.1 (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.8.2 <http://underscorejs.org/LICENSE>
|
||||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
* 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-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
* Available under MIT license <https://lodash.com/license>
|
||||
*/
|
||||
var baseIndexOf = require('lodash._baseindexof');
|
||||
|
||||
/** Used for native method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
|
||||
/** Native method references. */
|
||||
var splice = arrayProto.splice;
|
||||
var pullAll = require('lodash.pullall'),
|
||||
rest = require('lodash.rest');
|
||||
|
||||
/**
|
||||
* Removes all provided values from `array` using
|
||||
@@ -35,26 +30,6 @@ var splice = arrayProto.splice;
|
||||
* console.log(array);
|
||||
* // => [1, 1]
|
||||
*/
|
||||
function pull() {
|
||||
var args = arguments,
|
||||
array = args[0];
|
||||
|
||||
if (!(array && array.length)) {
|
||||
return array;
|
||||
}
|
||||
var index = 0,
|
||||
indexOf = baseIndexOf,
|
||||
length = args.length;
|
||||
|
||||
while (++index < length) {
|
||||
var fromIndex = 0,
|
||||
value = args[index];
|
||||
|
||||
while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
|
||||
splice.call(array, fromIndex, 1);
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
var pull = rest(pullAll);
|
||||
|
||||
module.exports = pull;
|
||||
|
||||
Reference in New Issue
Block a user