Skip to content

Handling "undefined" #39

Description

@snicol21

Maybe this is by design, but I was surprised to learn that this:

import { merge } from "merge-anything"

const defaultTheme = {}
const theme = undefined

merge(defaultTheme, theme)

Returns undefined. Is this expected, maybe it is, but I was kind of expecting it to return {}. Am I right?

I would hate to have to handle this scenario like this everytime:

merge(defaultTheme, theme || {})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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