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.
18 lines
402 B
18 lines
402 B
'use strict'; |
|
|
|
var callable = require('es5-ext/object/valid-callable') |
|
, forOf = require('es6-iterator/for-of') |
|
|
|
, call = Function.prototype.call; |
|
|
|
module.exports = function (cb/*, thisArg*/) { |
|
var thisArg = arguments[1], result = true; |
|
callable(cb); |
|
forOf(this, function (value, doBreak) { |
|
if (!call.call(cb, thisArg, value)) { |
|
result = false; |
|
doBreak(); |
|
} |
|
}); |
|
return result; |
|
};
|
|
|