Iterator helper
@param  {(Array|Object)}   collection Any object, array or array-like collection.
@param  {Function} callback   The callback function
@param  {Object}   scope      Change the value of this
@return {Void}
324449
function each(collection, callback, scope) {
		if ("[object Object]" === Object.prototype.toString.call(collection)) {
			for (var d in collection) {
				if (Object.prototype.hasOwnProperty.call(collection, d)) {
					callback.call(scope, d, collection[d]);
				}
			}
		} else {
			for (var e = 0, f = collection.length; e < f; e++) {
				callback.call(scope, e, collection[e]);
			}
		}
	}
684918
protected function iterate(IterableResult $iterator, callable $callback = null)
    {
        $iteration = 0;
        foreach ($iterator as $object) {
            /** @var Redirect $object */
            $object = current($object);
            yield $object;
            if ($callback !== null) {
                call_user_func($callback, $iteration, $object);
            }
            $iteration++;
        }
    }
694630
function forEach(callbackfn /* , that = undefined */) {
	        _validateCollection(this, NAME);
	        var f = _ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
	        var entry;
	        while (entry = entry ? entry.n : this._f) {
	          f(entry.v, entry.k, this);
	          // revert to the last existing entry
	          while (entry && entry.r) {
	            entry = entry.p;
	          }
	        }
	      }
841514
function(arr, iterator) {
			return Promise.map.call(this, arr, function(item, index, value) {
				return iterator.call(this, item, index, value);
			}.bind(this)).return(arr);
		}
783662
function(arg, callback) {
    if (!arg || typeof arg !== 'object') return;

    if (arg instanceof Array) {
      arg.forEach(callback);
    } else {
      for (var k in arg) {
        callback(arg[k], k);
      }
    }
  }
879714
function Iterator() {
    var items = Array.prototype.slice.call(arguments, 0);

    this.items = (items.length == 1 && Array.isArray(items[0])) ? items[0] : items;
    this.reset();
}
1163151
function each(object, callback) {
    var index = -1,
        length = object ? object.length : 0;

    if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
      while (++index < length) {
        callback(object[index], index, object);
      }
    } else {
      forOwn(object, callback);
    }
  }
1093394
function iterator(filename, callback) {
    
    async.forEach(
      
        filters
      
      , function(filter, callback) {
          
          var test
            , regexp
            , matches
            
            , continuation  = filter[1]
            
            , file_path     = path.join(dir_path, filename)
            , emitter
            ;
          
          if (typeof filter[0] === 'string') {
            
            regexp = new RegExp('^' + filter[0] + '$');
            matches = regexp.exec(filename);
            
            checkAndContinue(null, matches);
            
          } else if (filter[0] instanceof RegExp) {
            
            regexp  = filter[0];
            matches = regexp.exec(filename);
            checkAndContinue(null, matches);
            
          } else {
            
            test = filter[0]
            test(filename, file_path, checkAndContinue);
            
          }
          
          function checkAndContinue(err, matches) {
            
            if (err) {
             
              callback(err);
            
            } else if (matches) {
              
              emitter = new FileEventEmitter(file_path);
              
              continuation(emitter, matches, callback);
              
            } else {
              
              callback(null);
              
            }
          
          }
        
        }
        
      , callback
    );
    
  }
897833
function collection() {
  var source = [];
  var api = {
    length: 0,

    push: function (item) {
      source.push(item);
      this.length += 1;

      api.fire('changed', { added: [item] });
    },

    splice: function (idx, count) {
      var removed = source.splice(idx, count);
      this.length = source.length;
      api.fire('changed', { removed: removed, removeIdx: idx });
    },

    get : function (idx) {
      return source[idx];
    },

    forEach: function (callback, thisArg) {
      source.forEach(callback, thisArg);
    }
  };

  eventify(api);

  return api;
}
72084
function forAsync(items, iter, callback) {
	var keys = Object.keys(items);
	var step = function (err, callback) {
		nextTick(function () {
			if (err) {
				return callback(err);
			}
			if (keys.length === 0) {
				return callback();
			}
			var key = keys.pop();
			iter(items[key], key, function (err) {
				step(err, callback);
			});
		});
	};
	step(null, callback);
}
1031553
function iterate(iterator, callback) {
	        var self = this;

	        var promise = self.ready().then(function () {
	            var dbInfo = self._dbInfo;
	            var keyPrefix = dbInfo.keyPrefix;
	            var keyPrefixLength = keyPrefix.length;
	            var length = localStorage.length;

	            // We use a dedicated iterator instead of the `i` variable below
	            // so other keys we fetch in localStorage aren't counted in
	            // the `iterationNumber` argument passed to the `iterate()`
	            // callback.
	            //
	            // See: github.com/mozilla/localForage/pull/435#discussion_r38061530
	            var iterationNumber = 1;

	            for (var i = 0; i < length; i++) {
	                var key = localStorage.key(i);
	                if (key.indexOf(keyPrefix) !== 0) {
	                    continue;
	                }
	                var value = localStorage.getItem(key);

	                // If a result was found, parse it from the serialized
	                // string into a JS object. If result isn't truthy, the
	                // key is likely undefined and we'll pass it straight
	                // to the iterator.
	                if (value) {
	                    value = dbInfo.serializer.deserialize(value);
	                }

	                value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);

	                if (value !== void 0) {
	                    return value;
	                }
	            }
	        });

	        executeCallback(promise, callback);
	        return promise;
	    }
1328789
function(obj, iterator, context) {
        if (!obj) return
        else if (obj.forEach) obj.forEach(iterator)
        else if (obj.length == +obj.length) {
            for (var i = 0; i < obj.length; i++) iterator.call(context, obj[i], i)
        } else {
            for (var key in obj) iterator.call(context, obj[key], key)
        }
    }
179875
function each(collection, callback) {
        if (utils.isNode(collection) || collection === window || collection === document) {
            collection = [collection];
        }
        if (!utils.isArrayLike(collection) && !utils.isObject(collection)) {
            collection = [collection];
        }
        if (utils.size(collection) == 0) {
            return;
        }

        if (utils.isArrayLike(collection) && !utils.isObject(collection)) {
            var l = collection.length,
                i = 0;
            for (; i < l; i++) {
                if (callback.call(collection[i], collection[i], i, collection) === false) {
                    break;
                }
            }
        } else if (utils.isObject(collection)) {
            for (var key in collection) {
                if (utils.has(collection, key)) {
                    if (callback.call(collection[key], collection[key], key, collection) === false) {
                        break;
                    }
                }
            }
        }
    }
1110448
function Iterator(iterator) {

    if (Array.isArray(iterator) || typeof iterator == "string")
        return Iterator.iterate(iterator);

    iterator = Object(iterator);

    if (!(this instanceof Iterator))
        return new Iterator(iterator);

    this.next = this.send =
        iterator.send || iterator.next || iterator;

    if (
        Object.prototype.toString.call(this.next) !=
        "[object Function]"
    )
        throw new TypeError();

}
669230
function(callback) {
      var i = 0,
          keys = this.keys(),
          returned;

      for (i; i < keys.length; i++) {
        returned = callback(keys[i], this.get(keys[i]));
        if (returned === false) { return false; }
      };
    }
1031532
function __Collection(iterableOrGenerator) {
                    _classCallCheck(this, __Collection);

                    //#endregion
                    //#region Iterable
                    this.__iterable = null;
                    __assert(__isIterable(iterableOrGenerator) || __isGenerator(iterableOrGenerator), 'iterable or generator', iterableOrGenerator);
                    this.__iterable = iterableOrGenerator;
                }
7643
function (name, cb) {
    var i, j, cbs=this._callbacks[name], jsTemp=[];

    /* I'm not sure if this is necessary; in C++, iterating over a
     * collection and modifying it at the same time is a no-no.
     */

    for (j in cbs) {
      if (cbs.hasOwnProperty(j) && cbs[j] === cb) {
        jsTemp.push(j);
      }
    }

    for (i=0; i<jsTemp.length; i++) {
      j = jsTemp[i];
      delete cbs[j];
    }
  }