Skip to content

When source is undefined, mergedeep returns source #72

@shivakanthreddy

Description

@shivakanthreddy

_deepmerge(target, source) returns source when source is undefined, rather it should be target.

example:
`
const deepmergeFastify = require('@fastify/deepmerge')({clone: false})
let target: {key: value}
const source: undefined

target = deepmergeFastify(target, source)
// target will be undefined here

But target should be returned as is.
I suspect the issue might be at this line https://github.com/fastify/deepmerge/blob/main/index.js#L136

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions