-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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/which] Update the options of which
for version 3.0.0.
#69576
[@types/which] Update the options of which
for version 3.0.0.
#69576
Conversation
@vthemelis Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through. This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 69576,
"author": "vthemelis",
"headCommitOid": "3eec79d57f3988aa502f1431de299325ff20016f",
"mergeBaseOid": "86953d1148f231c8f1c534e4a718ac4fa7888767",
"lastPushDate": "2024-05-11T17:18:52.000Z",
"lastActivityDate": "2024-05-30T17:24:16.000Z",
"maintainerBlessed": "Waiting for Code Reviews",
"mergeOfferDate": "2024-05-30T16:55:58.000Z",
"mergeRequestDate": "2024-05-30T17:24:16.000Z",
"mergeRequestUser": "vthemelis",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "which",
"kind": "edit",
"files": [
{
"path": "types/which/index.d.ts",
"kind": "definition"
},
{
"path": "types/which/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/which/which-tests.ts",
"kind": "test"
}
],
"owners": [
"vvakame",
"cspotcode",
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "sheetalkamat",
"date": "2024-05-30T16:55:21.000Z",
"isMaintainer": true
},
{
"type": "approved",
"reviewer": "alvinsga",
"date": "2024-05-24T09:06:03.000Z",
"isMaintainer": false
},
{
"type": "stale",
"reviewer": "EduardoAC",
"date": "2024-05-21T21:05:59.000Z",
"abbrOid": "e28621b"
}
],
"mainBotCommentID": 2105959863,
"ciResult": "pass"
} |
🔔 @vvakame @cspotcode @peterblazejewicz — please review this PR in the next few days. Be sure to explicitly select |
7c2f555
to
8e7da45
Compare
The issue with this is that something like: which('blah', { not_a_real_option: true }) typechecks fine (when it should probably not). Not totally sure how to avoid this just now. Would you recommend that I add more overloads instead? |
which
.which
.
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.
LGTM
8e7da45
to
1e32275
Compare
@vvakame, could you have a look? I think that there is parity in terms of what does and doesn't compiler now with the previous version (excluding the intentionally introduced new behaviour). |
@EduardoAC Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
1e32275
to
a4d48dd
Compare
a4d48dd
to
446c9c2
Compare
which
.which
for version 3.0.0.
CC @cspotcode |
446c9c2
to
d344ac9
Compare
@EduardoAC can I have another review? I pushed some more changes to completely address typing for the latest version of the package. |
types/which/index.d.ts
Outdated
// nothrow not specified | ||
: TRet; | ||
|
||
type AddArray<TOptions, TRet> = TOptions extends { all: infer TVal } |
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.
Can you expand on the naming for AddNull and AdddArray? I see that the new type a bit obscure to understand what it represents.
When i see the code feels that you are more appending or transforming the original types
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.
Sure, happy to do that. What name would work best? Maybe NullableIfNoThrow and ArrayIfAll ?
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.
Sure, happy to do that. What name would work best? Maybe NullableIfNoThrow and ArrayIfAll ?
I was thinking something quite similar. Something in linesAppendNullIfNothrow
and TransformToArrayIfAll
. What are your thoughts? If you prefer yours, i will accept them as well
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.
Sounds good, will amend later.
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.
Done!
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.
Well done, i appreciated the improvements
* Add `nothrow` option to both the sync and async APIs * Add the missing `delimiter` option * Refine typing when `all` or `nothrow` are specified but it can't be inferred if they are specified to `true` or `false` but a general `boolean`. These have been available on the package since version 3.0.0: npm/node-which@8b0187c
e28621b
to
3eec79d
Compare
@EduardoAC Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
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.
LGTM
Thanks for the review @EduardoAC ! Do I need to get another review before merging? |
Usually, the merge is done by the repository owner, but if you can merge, go ahead. LGTM |
Re-ping @vvakame, @cspotcode, @peterblazejewicz: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
It has been more than two weeks and this PR still has no reviews. I'll bump it to the DT maintainer queue. Thank you for your patience, @vthemelis. (Ping @vvakame, @cspotcode, @peterblazejewicz.) |
@vthemelis: Everything looks good here. I am ready to merge this PR (at 3eec79d) on your behalf whenever you think it's ready. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ (@vvakame, @cspotcode, @peterblazejewicz: you can do this too.) |
Ready to merge |
Add
nothrow
option to both the sync and async APIs and add the missingdelimiter
option.These have been available on the package since version 3.0.0: npm/node-which@8b0187c
Please fill in this template.
pnpm test which
.Select one of these and delete the others:
If changing an existing definition:
package.json
.