mirror of
https://github.com/JasonYANG170/IOTConnect-Web.git
synced 2024-11-27 14:16:34 +00:00
18 lines
406 B
JavaScript
18 lines
406 B
JavaScript
|
"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;
|
||
|
};
|