12345678910111213141516171819202122232425262728293031323334353637 |
- import baseUnset from './_baseUnset.js';
- import isIndex from './_isIndex.js';
- var arrayProto = Array.prototype;
- var splice = arrayProto.splice;
- function basePullAt(array, indexes) {
- var length = array ? indexes.length : 0,
- lastIndex = length - 1;
- while (length--) {
- var index = indexes[length];
- if (length == lastIndex || index !== previous) {
- var previous = index;
- if (isIndex(index)) {
- splice.call(array, index, 1);
- } else {
- baseUnset(array, index);
- }
- }
- }
- return array;
- }
- export default basePullAt;
|