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(BitField): use only enum names in iterating #9357

Merged
merged 4 commits into from
Apr 28, 2023

Conversation

jaw0r3k
Copy link
Contributor

@jaw0r3k jaw0r3k commented Apr 9, 2023

Please describe the changes this PR makes and why it should be merged:
Resolves: #9350
The change may seem weird, but its working.
As enums are reverse mapped, getting keys will not only give names but values
The shown exception was permissions, but its just an object

Status and versioning classification:

  • Typings don't need updating
  • This PR only includes non-code changes, like changes to documentation, README, etc.

@vercel
Copy link

vercel bot commented Apr 9, 2023

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

Name Status Preview Comments Updated (UTC)
discord-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 28, 2023 5:27pm
discord-js-guide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 28, 2023 5:27pm

@vercel
Copy link

vercel bot commented Apr 9, 2023

@jaw0r3k is attempting to deploy a commit to the discordjs Team on Vercel.

A member of the Team first needs to authorize it.

@jaw0r3k jaw0r3k changed the title fix: fix iterating bitfield fix(BitField): use only enum names in iterating Apr 9, 2023
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

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

sure

@Jiralite
Copy link
Member

Jiralite commented Apr 13, 2023

It looks like this needs backporting, would you mind doing it?

@jaw0r3k
Copy link
Contributor Author

jaw0r3k commented Apr 13, 2023

It looks like this needs backporting, would you mind doing it?

Sure <3

Copy link
Member

@SpaceEEC SpaceEEC left a comment

Choose a reason for hiding this comment

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

On a second look, this needs to be applied to other places traversing Flags too.
This only seems to be serialize (currently).


> new ActivityFlagsBitField(511).serialize()
{
  '1': true,
  '2': true,
  '4': true,
  '8': true,
  '16': true,
  '32': true,
  '64': true,
  '128': true,
  '256': true,
  Instance: true,
  Join: true,
  Spectate: true,
  JoinRequest: true,
  Sync: true,
  Play: true,
  PartyPrivacyFriends: true,
  PartyPrivacyVoiceChannel: true,
  Embedded: true
}

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
@jaw0r3k jaw0r3k requested a review from a team as a code owner April 23, 2023 18:57
@Jiralite Jiralite requested a review from SpaceEEC April 23, 2023 19:01
@github-actions
Copy link

github-actions bot commented Apr 28, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 98
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 100
🟠 PWA 70

Lighthouse ran on https://discord-js-git-fork-jaw0r3k-patch-4-discordjs.vercel.app/

@kodiakhq kodiakhq bot merged commit 40d07fb into discordjs:main Apr 28, 2023
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.

BitField#toArray() returning the bitfield with the bitfield name
5 participants