-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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): simplify ambient constructor declaration #10549
Merged
kodiakhq
merged 2 commits into
discordjs:main
from
Renegade334:collection-constructor-types
Nov 7, 2024
Merged
types(collection): simplify ambient constructor declaration #10549
kodiakhq
merged 2 commits into
discordjs:main
from
Renegade334:collection-constructor-types
Nov 7, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Renegade334
requested review from
ckohen,
vladfrangu,
iCrawl,
kyranet,
didinele and
Jiralite
October 11, 2024 00:00
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
- deduplicates constructor definition - removes Collection's "internal" JSDoc description block - removes unnecessary `extends` clause
Renegade334
force-pushed
the
collection-constructor-types
branch
from
October 11, 2024 01:06
2b3207d
to
4955cba
Compare
didinele
approved these changes
Nov 1, 2024
vladfrangu
approved these changes
Nov 4, 2024
ckohen
approved these changes
Nov 7, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10549 +/- ##
==========================================
- Coverage 38.16% 37.97% -0.19%
==========================================
Files 239 239
Lines 15500 15433 -67
Branches 1371 1366 -5
==========================================
- Hits 5915 5861 -54
+ Misses 9570 9557 -13
Partials 15 15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
collection.ts needs an ambient declaration for
Collection.prototype.constructor
in order for the TypeScript compiler to understandthis.constructor[Symbol.species]
references within class methods.The existing implementation of this is a little clumsy. This refactor simplifies the declaration significantly, and also removes the risk of the
constructor
property type becoming out-of-sync with Collection if changes are made to the constructor.Removes the redundant
CollectionConstructor
interface which, although exported, is marked@internal
and doesn't appear in the docs, therefore should probably be OK to count as a non-breaking change.Status and versioning classification: