-
-
Notifications
You must be signed in to change notification settings - Fork 531
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 RequiredDeep
type
#401
Conversation
note: the issue linked in the PR description points to the contribution guidelines instead of an actual issue. Is this by mistake? |
It’s this issue I think. |
sorry(( wrong link |
Yes you are right |
? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> | ||
: E extends ReadonlySet<infer ItemType> | ||
? ReadonlySet<RequiredDeep<ItemType>> | ||
: E extends (arg: any[]) => unknown |
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 think there is a small typo here, this type will only match functions with a single array argument. From my (limited) testing it should actually be : E extends (...arg: any[]) => unknown
to match all types of function args.
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.
@ilchenkoArtem Make sure you add a test for this too.
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 wil fix this it this week
Make sure you look at our existing "deep" types and that this new types handles all the cases handled by them. For example, type-fest/source/readonly-deep.d.ts Line 80 in 2f418db
|
type ExcludeUndefined<T> = Exclude<T, undefined>; | ||
|
||
/** | ||
Create a type from another type with all keys and nested keys set to optional. |
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.
Make sure the docs are correct.
interface FooRequired { | ||
baz: string; | ||
bar: { | ||
function: (...args: any[]) => void; |
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.
function: (...args: any[]) => void; | |
function: (...arguments: any[]) => void; |
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.
The term arguments
is not allowed when TypeScript is in strict mode anymore, if it ever way.
CI is failing |
} | ||
``` | ||
|
||
@category Utilities |
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.
type-fest/source/partial-deep.d.ts
Lines 31 to 34 in 2f418db
@category Object | |
@category Array | |
@category Set | |
@category Map |
Friendly bump :) |
soory, I am not having time now(( I am having a lot of work( |
Closing for lack of activity. |
Fixes #273