mirror of
https://github.com/github/codeql-action.git
synced 2025-12-26 09:10:07 +08:00
* --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm - dependency-name: sinon dependency-type: direct:development update-type: version-update:semver-major dependency-group: npm ... Signed-off-by: dependabot[bot] <support@github.com> * Update checked-in dependencies --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
27 lines
663 B
JavaScript
27 lines
663 B
JavaScript
"use strict";
|
|
|
|
/**
|
|
* Returns true when fn returns true for all members of obj.
|
|
* This is an every implementation that works for all iterables
|
|
* @param {object} obj
|
|
* @param {Function} fn
|
|
* @returns {boolean}
|
|
*/
|
|
module.exports = function every(obj, fn) {
|
|
var pass = true;
|
|
|
|
try {
|
|
// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
|
|
obj.forEach(function () {
|
|
if (!fn.apply(this, arguments)) {
|
|
// Throwing an error is the only way to break `forEach`
|
|
throw new Error();
|
|
}
|
|
});
|
|
} catch (e) {
|
|
pass = false;
|
|
}
|
|
|
|
return pass;
|
|
};
|