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

9160 - Assign #15345

Open
huangyuanjin opened this issue Sep 1, 2022 · 0 comments
Open

9160 - Assign #15345

huangyuanjin opened this issue Sep 1, 2022 · 0 comments
Labels
9160 answer Share answers/solutions to a question en in English

Comments

@huangyuanjin
Copy link

// your answers
type Merge<F, S> = {
    [K in keyof F | keyof S]: K extends keyof S ? S[K] : K extends keyof F ? F[K] : never
}

type Assign<T extends Record<string, unknown>, U> = U extends [infer K, ...infer R]
    ? K extends Record<string, unknown>
        ? Assign<Merge<T, K>, R>
        : Assign<T, R>
    : T
@huangyuanjin huangyuanjin added answer Share answers/solutions to a question en in English labels Sep 1, 2022
@github-actions github-actions bot added the 9160 label Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9160 answer Share answers/solutions to a question en in English
Projects
None yet
Development

No branches or pull requests

1 participant