-
-
Notifications
You must be signed in to change notification settings - Fork 597
Fix documentation for include and select #601
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
Conversation
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.
Why isn’t the change reflected in the type of the keys param?
Ah, thanks, I totally missed that you're using both type annotations in comments, and TS annotations |
These both can accept either a string, or an array of strings
Codecov Report
@@ Coverage Diff @@
## master #601 +/- ##
=======================================
Coverage 84.57% 84.57%
=======================================
Files 48 48
Lines 4039 4039
Branches 911 911
=======================================
Hits 3416 3416
Misses 623 623
Continue to review full report at Codecov.
|
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 there’s still a mismatch, the thing is, the keys are spread, So it’s already accurate, a single string, an array of string are valid values.
I'm not sure what you want it to say. The way it's written, you could pass multiple arrays of strings, like I was following the docs at https://www.typescriptlang.org/docs/handbook/functions.html#rest-parameters which seem to imply that the type of a |
Right, that’s this part that’s confusing (spread of (string or arrays of strings) ) instead of ((spread of string) or (array of strings)) In doubt that’s confusing and even if it’s supported it’s rather make the documentation unambiguous even if it means sacrificing a ‘feature’ or corner case. What do you think? In the end, it supports only arrays, which can be strings of arrays of strings. So we should remove the spread operator from the jsdocs as it’s confusing (me) an perhaps others. What do you think? |
Okay so you can basically call it in two ways: You can call it as though the I'm not sure how to represent that in the JSDoc. Maybe just what I have in the PR currently, except with parens: |
The parens may help with the readability. |
Thanks! |
These both can accept either a string, or an array of strings