-
-
Notifications
You must be signed in to change notification settings - Fork 571
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 Paths
type
#741
Add Paths
type
#741
Conversation
It was suggested in the issue that the |
And this is a broken change if replace type directly, so we should think about backward compatibility, example we can use |
Should resolve this question in current PR, need your help~ @sindresorhus I perfer add a option to choose the handling of array, this is more flexible |
I forgot that |
Changes:
|
Nice work 🎉 |
? T[Key] extends UnknownRecord | UnknownArray | ||
? ( | ||
IsNever<Paths<T[Key]>> extends false | ||
// If `Key` is number, return `Key | `${Key}``. Because both `array[0]` and `array['0']` are work. | ||
// If `Key` is a number, return `Key | `${Key}``, because both `array[0]` and `array['0']` do not work. |
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.
Is this a mistake? @sindresorhus
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.
Yes, fixed.
Paths
type #213Paths
type #300