-
-
Notifications
You must be signed in to change notification settings - Fork 624
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`
? _Filter<Rest, Type, Strict, [ | ||
...HeadAcc, | ||
...IfFilter<FilterType<First, Type, Strict>, | ||
'0' extends OptionalKeysOf<Array_> // TODO: replace with `IsOptionalKeyOf`. |
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.
This can be done now.
If `Type` is `Boolean`, it filters out `falsy` values like {@link Boolean `Boolean(T)`} does. | ||
|
||
Strict controls whether strict or loose type comparison is used (defaults to loose). | ||
|
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.
Need proper usage examples.
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. |
Closes #1181
Filters elements from an
Array
/Object
based on whether there members match the givenType
.If
Type
isBoolean
, it filters outfalsy
values likeBoolean(T)
does.Strict controls whether strict or loose type comparison is used (defaults to loose). I will add this as on option eventually!