mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Bump to v3.7.0.
This commit is contained in:
@@ -1,15 +1,9 @@
|
||||
var baseAt = require('../internal/baseAt'),
|
||||
baseCompareAscending = require('../internal/baseCompareAscending'),
|
||||
baseFlatten = require('../internal/baseFlatten'),
|
||||
isIndex = require('../internal/isIndex'),
|
||||
basePullAt = require('../internal/basePullAt'),
|
||||
restParam = require('../function/restParam');
|
||||
|
||||
/** Used for native method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
|
||||
/** Native method references. */
|
||||
var splice = arrayProto.splice;
|
||||
|
||||
/**
|
||||
* Removes elements from `array` corresponding to the given indexes and returns
|
||||
* an array of the removed elements. Indexes may be specified as an array of
|
||||
@@ -39,17 +33,8 @@ var pullAt = restParam(function(array, indexes) {
|
||||
array || (array = []);
|
||||
indexes = baseFlatten(indexes);
|
||||
|
||||
var length = indexes.length,
|
||||
result = baseAt(array, indexes);
|
||||
|
||||
indexes.sort(baseCompareAscending);
|
||||
while (length--) {
|
||||
var index = parseFloat(indexes[length]);
|
||||
if (index != previous && isIndex(index)) {
|
||||
var previous = index;
|
||||
splice.call(array, index, 1);
|
||||
}
|
||||
}
|
||||
var result = baseAt(array, indexes);
|
||||
basePullAt(array, indexes.sort(baseCompareAscending));
|
||||
return result;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user