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

refactor: compare with undefined directly #9191

Merged
merged 3 commits into from Mar 12, 2023

Conversation

almeidx
Copy link
Member

@almeidx almeidx commented Mar 3, 2023

Please describe the changes this PR makes and why it should be merged:
Updated all of the typeof x === "undefined" into x === undefined (also !==) as it is needlessly verbose since in strict mode the only reason to use typeof is if x might not be declared

This also brings in more consistency since x === undefined was already being used in some places (!== too), e.g.


this._cache.maxSize === undefined ||

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes

@vercel
Copy link

vercel bot commented Mar 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
discord-js ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 12, 2023 at 8:12PM (UTC)
discord-js-guide ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 12, 2023 at 8:12PM (UTC)

@codecov
Copy link

codecov bot commented Mar 12, 2023

Codecov Report

Merging #9191 (6cb9de7) into main (955e8fe) will not change coverage.
The diff coverage is 86.95%.

@@           Coverage Diff           @@
##             main    #9191   +/-   ##
=======================================
  Coverage   83.70%   83.70%           
=======================================
  Files         100      100           
  Lines        9550     9550           
  Branches     1101     1101           
=======================================
  Hits         7994     7994           
  Misses       1517     1517           
  Partials       39       39           
Flag Coverage Δ
builders 98.25% <ø> (ø)
collection 100.00% <100.00%> (ø)
next ∅ <ø> (∅)
proxy 79.56% <ø> (ø)
rest 92.07% <ø> (ø)
voice 63.47% <50.00%> (ø)
ws 58.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/voice/src/networking/Networking.ts 3.18% <0.00%> (ø)
packages/voice/src/networking/VoiceWebSocket.ts 0.00% <0.00%> (ø)
packages/voice/src/receive/AudioReceiveStream.ts 100.00% <ø> (ø)
packages/voice/src/VoiceConnection.ts 81.76% <50.00%> (ø)
packages/collection/src/collection.ts 100.00% <100.00%> (ø)
packages/voice/src/DataStore.ts 98.14% <100.00%> (ø)
packages/voice/src/audio/AudioResource.ts 95.23% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kodiakhq kodiakhq bot merged commit 869153c into discordjs:main Mar 12, 2023
@almeidx almeidx deleted the refactor/typeof-undefined branch March 12, 2023 20:42
cyan-2048 pushed a commit to cyan-2048/discord.js that referenced this pull request May 8, 2024
* refactor: compare with `undefined` directly

* fix: lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants