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

fix: MergeDeep type to more gracefully merge optional nested object types #32

Open
mesqueeb opened this issue Nov 14, 2022 · 0 comments

Comments

@mesqueeb
Copy link
Owner

type D1 = { [key in string]?: { cool: boolean } | null }
type D2 = { [key in string]?: { notCool: boolean } | null }
type TestD = PrettyPrint<MergeDeep<D1, D2>>

current

{
    [x: string]: {
        cool: boolean;
    } | {
        notCool: boolean;
    } | {
        cool: boolean;
        notCool: boolean;
    } | null;
}

expected

{
    [x: string]: {
        cool?: boolean;
        notCool?: boolean;
    } | null;
}
@mesqueeb mesqueeb changed the title fix: MergeDeep to more gracefully merge optional nested objects fix: MergeDeep type to more gracefully merge optional nested object types Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant