Sha256: 3438851db62b7449317f412a88357c0e39ecf501e170c7f1ee13680a5bee56ca

Contents?: true

Size: 1.15 KB

Versions: 66

Compression:

Stored size: 1.15 KB

Contents

var ctx = require('./_ctx');
var call = require('./_iter-call');
var isArrayIter = require('./_is-array-iter');
var anObject = require('./_an-object');
var toLength = require('./_to-length');
var getIterFn = require('./core.get-iterator-method');
var BREAK = {};
var RETURN = {};
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  var f = ctx(fn, that, entries ? 2 : 1);
  var index = 0;
  var length, step, iterator, result;
  if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  // fast case for arrays with default iterator
  if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
    result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
    if (result === BREAK || result === RETURN) return result;
  } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
    result = call(iterator, f, step.value, entries);
    if (result === BREAK || result === RETURN) return result;
  }
};
exports.BREAK = BREAK;
exports.RETURN = RETURN;

Version data entries

66 entries across 30 versions & 8 rubygems

Version Path
immosquare-cleaner-0.1.52 node_modules/core-js/library/modules/_for-of.js
immosquare-cleaner-0.1.52 node_modules/core-js/modules/_for-of.js
immosquare-cleaner-0.1.51 node_modules/core-js/modules/_for-of.js
immosquare-cleaner-0.1.51 node_modules/core-js/library/modules/_for-of.js
immosquare-cleaner-0.1.50 node_modules/core-js/library/modules/_for-of.js
immosquare-cleaner-0.1.50 node_modules/core-js/modules/_for-of.js
immosquare-cleaner-0.1.49 node_modules/core-js/library/modules/_for-of.js
immosquare-cleaner-0.1.49 node_modules/core-js/modules/_for-of.js
immosquare-cleaner-0.1.48 node_modules/core-js/library/modules/_for-of.js
immosquare-cleaner-0.1.48 node_modules/core-js/modules/_for-of.js
immosquare-cleaner-0.1.47 node_modules/core-js/library/modules/_for-of.js
immosquare-cleaner-0.1.47 node_modules/core-js/modules/_for-of.js
immosquare-cleaner-0.1.46 node_modules/core-js/library/modules/_for-of.js
immosquare-cleaner-0.1.46 node_modules/core-js/modules/_for-of.js
immosquare-cleaner-0.1.45 node_modules/core-js/library/modules/_for-of.js
immosquare-cleaner-0.1.45 node_modules/core-js/modules/_for-of.js
immosquare-cleaner-0.1.44 node_modules/core-js/library/modules/_for-of.js
immosquare-cleaner-0.1.44 node_modules/core-js/modules/_for-of.js
immosquare-cleaner-0.1.43 node_modules/core-js/library/modules/_for-of.js
immosquare-cleaner-0.1.43 node_modules/core-js/modules/_for-of.js