Sha256: 4edd40dac0897bc73302f2104663d475b186f26ca6443997a34c80a19fb14a0c

Contents?: true

Size: 939 Bytes

Versions: 261

Compression:

Stored size: 939 Bytes

Contents

var baseUnset = require('./_baseUnset'),
    isIndex = require('./_isIndex');

/** Used for built-in method references. */
var arrayProto = Array.prototype;

/** Built-in value references. */
var splice = arrayProto.splice;

/**
 * The base implementation of `_.pullAt` without support for individual
 * indexes or capturing the removed elements.
 *
 * @private
 * @param {Array} array The array to modify.
 * @param {number[]} indexes The indexes of elements to remove.
 * @returns {Array} Returns `array`.
 */
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;
}

module.exports = basePullAt;

Version data entries

261 entries across 260 versions & 28 rubygems

Version Path
govuk_publishing_components-17.14.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.13.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.12.2 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.12.1 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.12.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.11.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.10.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.9.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.8.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.7.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.6.1 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.6.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.5.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.4.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.3.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.2.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.1.1 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.1.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-17.0.0 node_modules/lodash/_basePullAt.js
govuk_publishing_components-16.29.0 node_modules/lodash/_basePullAt.js