Sha256: 83afee417a830c72a92ce1652485e041c8d8851a5c9be110cf51d734d0a7899e

Contents?: true

Size: 821 Bytes

Versions: 64

Compression:

Stored size: 821 Bytes

Contents

var aFunction = require('./_a-function');
var toObject = require('./_to-object');
var IObject = require('./_iobject');
var toLength = require('./_to-length');

module.exports = function (that, callbackfn, aLen, memo, isRight) {
  aFunction(callbackfn);
  var O = toObject(that);
  var self = IObject(O);
  var length = toLength(O.length);
  var index = isRight ? length - 1 : 0;
  var i = isRight ? -1 : 1;
  if (aLen < 2) for (;;) {
    if (index in self) {
      memo = self[index];
      index += i;
      break;
    }
    index += i;
    if (isRight ? index < 0 : length <= index) {
      throw TypeError('Reduce of empty array with no initial value');
    }
  }
  for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {
    memo = callbackfn(memo, self[index], index, O);
  }
  return memo;
};

Version data entries

64 entries across 29 versions & 8 rubygems

Version Path
immosquare-cleaner-0.1.51 node_modules/core-js/library/modules/_array-reduce.js
immosquare-cleaner-0.1.51 node_modules/core-js/modules/_array-reduce.js
immosquare-cleaner-0.1.50 node_modules/core-js/modules/_array-reduce.js
immosquare-cleaner-0.1.50 node_modules/core-js/library/modules/_array-reduce.js
immosquare-cleaner-0.1.49 node_modules/core-js/library/modules/_array-reduce.js
immosquare-cleaner-0.1.49 node_modules/core-js/modules/_array-reduce.js
immosquare-cleaner-0.1.48 node_modules/core-js/library/modules/_array-reduce.js
immosquare-cleaner-0.1.48 node_modules/core-js/modules/_array-reduce.js
immosquare-cleaner-0.1.47 node_modules/core-js/library/modules/_array-reduce.js
immosquare-cleaner-0.1.47 node_modules/core-js/modules/_array-reduce.js
immosquare-cleaner-0.1.46 node_modules/core-js/library/modules/_array-reduce.js
immosquare-cleaner-0.1.46 node_modules/core-js/modules/_array-reduce.js
immosquare-cleaner-0.1.45 node_modules/core-js/library/modules/_array-reduce.js
immosquare-cleaner-0.1.45 node_modules/core-js/modules/_array-reduce.js
immosquare-cleaner-0.1.44 node_modules/core-js/library/modules/_array-reduce.js
immosquare-cleaner-0.1.44 node_modules/core-js/modules/_array-reduce.js
immosquare-cleaner-0.1.43 node_modules/core-js/library/modules/_array-reduce.js
immosquare-cleaner-0.1.43 node_modules/core-js/modules/_array-reduce.js
immosquare-cleaner-0.1.42 node_modules/core-js/library/modules/_array-reduce.js
immosquare-cleaner-0.1.42 node_modules/core-js/modules/_array-reduce.js