You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
367 B
13 lines
367 B
6 years ago
|
"use strict";
|
||
|
|
||
|
var forOf = require("es6-iterator/for-of")
|
||
|
, isIterable = require("es6-iterator/is-iterable")
|
||
|
, iterable = require("./validate")
|
||
|
|
||
|
, forEach = Array.prototype.forEach;
|
||
|
|
||
|
module.exports = function (target, cb/*, thisArg*/) {
|
||
|
if (isIterable(iterable(target))) forOf(target, cb, arguments[2]);
|
||
|
else forEach.call(target, cb, arguments[2]);
|
||
|
};
|