mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Bump to v4.11.2.
This commit is contained in:
12
pullAt.js
12
pullAt.js
@@ -3,6 +3,7 @@ import baseAt from './_baseAt';
|
||||
import baseFlatten from './_baseFlatten';
|
||||
import basePullAt from './_basePullAt';
|
||||
import compareAscending from './_compareAscending';
|
||||
import isIndex from './_isIndex';
|
||||
import rest from './rest';
|
||||
|
||||
/**
|
||||
@@ -30,10 +31,15 @@ import rest from './rest';
|
||||
* // => [10, 20]
|
||||
*/
|
||||
var pullAt = rest(function(array, indexes) {
|
||||
indexes = arrayMap(baseFlatten(indexes, 1), String);
|
||||
indexes = baseFlatten(indexes, 1);
|
||||
|
||||
var length = array ? array.length : 0,
|
||||
result = baseAt(array, indexes);
|
||||
|
||||
basePullAt(array, arrayMap(indexes, function(index) {
|
||||
return isIndex(index, length) ? +index : index;
|
||||
}).sort(compareAscending));
|
||||
|
||||
var result = baseAt(array, indexes);
|
||||
basePullAt(array, indexes.sort(compareAscending));
|
||||
return result;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user