Skip to content

Fix util.isFunction deprecation warning #3452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,9 @@
return true;
}

if (!util.isFunction) {
util.isFunction = functionToCheck => {
const getType = {};
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
};
}

logger.dump_and_exit = function (code) {
this.dump_logs(() => {
if (util.isFunction(code)) return code();
if (typeof code === 'function') return code();

Check warning on line 121 in logger.js

View check run for this annotation

Codecov / codecov/patch

logger.js#L121

Added line #L121 was not covered by tests
process.exit(code);
});
}
Expand Down
Loading