-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add .findLast() and .findLastIndex() #69
Add .findLast() and .findLastIndex() #69
Conversation
Signed-off-by: mbasov2 <[email protected]>
Signed-off-by: mbasov2 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great - one small comment.
@@ -0,0 +1,18 @@ | |||
//// [callChainWithSuper.ts] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test relevant to your changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it was created because the es2023
target was added (filename is callChainWithSuper(target=es2023).js
). This file was added for the es2022
target as well.
I wonder if adding es2023 as a target should be separated out as a separate PR. es2023 doesn't exist yet as a spec so it doesn't feel right that TypeScript would offer it as a target yet. 'esnext' seems more appropriate for now. |
Daniel suggests adding them to ES2023 in microsoft#48829 (comment). |
Ah cool. Thanks. I can also see that TypeScript also added es2022 before the spec was official so does seem like there is precedent for this. I'm happy. |
* Add .findLast(), .findLastIndex(), and es2023 target Signed-off-by: mbasov2 <[email protected]> * Update baselines Signed-off-by: mbasov2 <[email protected]>
* Add .findLast(), .findLastIndex(), and es2023 target Signed-off-by: mbasov2 <[email protected]> * Update baselines Signed-off-by: mbasov2 <[email protected]> Remove ES2023 target (#75) Signed-off-by: mbasov2 <[email protected]>
* Add .findLast(), .findLastIndex(), and es2023 target Signed-off-by: mbasov2 <[email protected]> * Update baselines Signed-off-by: mbasov2 <[email protected]> Remove ES2023 target (#75) Signed-off-by: mbasov2 <[email protected]>
microsoft#48829
Describe your changes
Add type definitions for
Array.prototype.findLast()
andArray.prototype.findLastIndex()
methods. Both methods were added to thees2023
target but the target didn't exist so I've created it. The definitions are identical to.find()
and.findIndex()
but with the updated comments.Testing performed
Added
findLast.ts
test file were all Array interfaces try to call.findLast()
and.findLastIndex()
.Also, tested it manually by running:
tsc
with thees5
target andlibs: []
tsc
with thees5
target andlibs: ["es2023"]
tsc
with thees5
target andlibs: ["esnext"]
Additional context
The
es2023
target were added with the help of this PR microsoft#46291