Skip to content
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

553 - Deep object to unique #2832

Open
myNameIsDu opened this issue Aug 21, 2021 · 2 comments
Open

553 - Deep object to unique #2832

myNameIsDu opened this issue Aug 21, 2021 · 2 comments
Labels
553 answer Share answers/solutions to a question en in English

Comments

@myNameIsDu
Copy link

type Merge<T> = {
  [P in keyof T]: T[P]
}
type DeepObjectToUniq<O extends object> = {
  [P in keyof O]: O[P] extends object
    ? DeepObjectToUniq<Merge<O[P] & { _xxx?: [O, P] }>>
    : O[P]
}
@myNameIsDu myNameIsDu added answer Share answers/solutions to a question en in English labels Aug 21, 2021
@github-actions github-actions bot added the 553 label Aug 21, 2021
@yangliguo7
Copy link

HI~ What does _xxx mean ?Why does this make the test run ?

@myNameIsDu
Copy link
Author

HI~ What does _xxx mean ?Why does this make the test run ?

It's just an optional property

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
553 answer Share answers/solutions to a question en in English
Projects
None yet
Development

No branches or pull requests

2 participants