-
-
Notifications
You must be signed in to change notification settings - Fork 653
Add Filter type
#1183
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
base: main
Are you sure you want to change the base?
Add Filter type
#1183
Conversation
…tion to `IsLeadingRestElement`
|
Needs to be added to readme and index.d.ts |
|
Make sure to go through the pull request yourself and the diff and find mistakes. Etc. AI can be helpful for this. |
|
Just pointing out that we also could merge them in one |
|
A single type is tempting. Any downsides? |
should not be any, I guess. |
|
@sindresorhus the merge of both types was flawless with no problems. |
Removed duplicate lines in type documentation.
source/internal/array.d.ts
Outdated
| type Fail2 = IsEmptyArray<[0?]>; | ||
| //=> false | ||
| type Fail3 = IsEmptyArray<...string[]>; |
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 don't think this is valid TS. Ensure all examples are correct.
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.
You're right, I fixed it.
Closes #1181
Filters elements from an
Array/Objectbased on whether there members match the givenType.If
TypeisBoolean, it filters outfalsyvalues likeBoolean(T)does.Strict controls whether strict or loose type comparison is used (defaults to loose). I will add this as on option eventually!