Skip to content
This repository was archived by the owner on Jan 8, 2022. It is now read-only.

Conversation

@ImRodry
Copy link
Contributor

@ImRodry ImRodry commented Nov 4, 2021

Please describe the changes this PR makes and why it should be merged:
This PR changes the typings for Collection#at and Collection#keyAt making the index parameter required. I labeled this as a types change because passing no index is still technically valid, but it was chosen to be considered invalid in TypeScript in the PR that introduced the es2022 lib, which came with Array.at() type definitions

Status and versioning classification:

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

@iCrawl iCrawl merged commit 9b42631 into discordjs:main Nov 6, 2021
@iCrawl iCrawl added the typings label Nov 6, 2021
@ImRodry ImRodry deleted the types-at-required branch November 6, 2021 08:24
@PabloLION
Copy link

Hi team. In playground v4.5.2, Array.prototype.at is still not supported. How should I configure TS to suppress the error?

@ImRodry
Copy link
Contributor Author

ImRodry commented Dec 11, 2021

es2022 will be added in TS 4.6.0 as you can see in the linked PR. However this PR and repo have absolutely nothing to do with TS

@PabloLION
Copy link

Ohh its discord repo! I like your project a lot. And thanks for the clarification!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants