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

types(Collection): make fn return type unknown #8676

Merged
merged 2 commits into from Sep 25, 2022

Conversation

ImRodry
Copy link
Contributor

@ImRodry ImRodry commented Sep 24, 2022

Please describe the changes this PR makes and why it should be merged:

This PR changes the type signature for all function parameters in the Collection class by making their return types unknown. This brings the types in line with the TypeScript lib types for the corresponding array methods. Since we're simply checking for truthiness in an if statement, the return type can be converted to a boolean automatically and doesn't need to be provided as one necessarily

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@vercel
Copy link

vercel bot commented Sep 24, 2022

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

1 Ignored Deployment
Name Status Preview Updated
discord-js ⬜️ Ignored (Inspect) Sep 25, 2022 at 11:34AM (UTC)

@codecov
Copy link

codecov bot commented Sep 24, 2022

Codecov Report

Merging #8676 (2d6cedd) into main (c446a84) will increase coverage by 0.12%.
The diff coverage is 100.00%.

❗ Current head 2d6cedd differs from pull request most recent head 96b90a2. Consider uploading reports for the commit 96b90a2 to get more accurate results

@@            Coverage Diff             @@
##             main    #8676      +/-   ##
==========================================
+ Coverage   86.66%   86.78%   +0.12%     
==========================================
  Files          86       85       -1     
  Lines        8771     8773       +2     
  Branches     1105     1109       +4     
==========================================
+ Hits         7601     7614      +13     
+ Misses       1128     1117      -11     
  Partials       42       42              
Flag Coverage Δ
builders 100.00% <100.00%> (ø)
collection 100.00% <100.00%> (ø)
proxy 80.46% <ø> (+6.36%) ⬆️
rest 91.99% <ø> (ø)
utilities 100.00% <ø> (?)
voice 63.83% <ø> (-0.04%) ⬇️
ws 60.47% <ø> (ø)

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

Impacted Files Coverage Δ
...ixins/ApplicationCommandOptionChannelTypesMixin.ts 100.00% <100.00%> (ø)
packages/collection/src/collection.ts 100.00% <100.00%> (ø)
packages/proxy/src/util/util.ts
packages/voice/src/util/util.ts
packages/actions/src/formatTag/formatTag.ts 100.00% <0.00%> (ø)

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

@kodiakhq kodiakhq bot merged commit 822b7f2 into discordjs:main Sep 25, 2022
@ImRodry ImRodry deleted the types/collection-fn-return-unknown branch September 25, 2022 11:41
imranbarbhuiya added a commit to imranbarbhuiya/discord.js that referenced this pull request Sep 28, 2022
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

4 participants