Skip to content
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

Fix util.isFunction deprecation warning #3452

Merged
merged 2 commits into from
Mar 24, 2025
Merged

Conversation

dalibor
Copy link
Contributor

@dalibor dalibor commented Mar 24, 2025

When stopping the server, I'm getting the following deprecation warning

^C(node:69460) [DEP0049] DeprecationWarning: The `util.isFunction` API is deprecated.  Please use `typeof arg === "function"` instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

https://nodejs.org/api/deprecations.html#DEP0049

@msimerson
Copy link
Member

I'm curious...the deprecation warning is suggesting that we use typeof arg === "function" instead. I have vague memories from long ago of that not always working. Hence the polyfill and then the use of util.isFunction. Considering that util.isFunction is now deprecated, perhaps typeof is now smart enough to do The Right Thing in every supported version of node.js?

Copy link
Member

@msimerson msimerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 🤞🏻

@msimerson msimerson merged commit 9686dc2 into haraka:master Mar 24, 2025
11 of 12 checks passed
@dalibor dalibor deleted the dep0049 branch March 24, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants