fix: Changed judgment of undefined to not use a function #1552
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Changed to not use
isUndefined
, which is deprecated in Node.js.Reason for change
As written in the overview, it is deprecated in Node.js. I changed it because it is possible to determine without using it.
Also, this may be a personal opinion, but I use this library with Cloudflare Workers. There are two options to use Node.js API with Cloudflare Workers.
I won't go into detail on how these two options are different, but the only way to make this library work is to use the former
node_compat
. Because to use thenodejs_compat
option, you need to specifynode:
(node:util
in this library) when using the Node.js API.Initially, I used this library with the
node_compat
option, but started to migrate to using thenodejs_compat
option. However, I noticed that this library cannot be built with thenodejs_compat
option. Those are theisUndefined
andutil
in this case.I could have patched it to reference
node:util
, but when I looked at the Node.js documentation I noticed that it was deprecated, so I submitted a pull request to fix the library.