Skip to content

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

@mesqueeb

Description

@mesqueeb
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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions