Skip to content

How to set undefined by dot.set #84

Description

@winjeysong

Thanks for your big work on maintaining this library. It helps me a log!

But now, I faced a problem.

// Do not operate if the value is undefined.
if (typeof val === 'undefined') {
return obj
}

Due to the code above, I can't set undefined like that:

const o = { foo: { bar: 'baz' } };
dot.set('foo.bar', undefined, o); // not work

So is there a way to set undefined by dot.set ? Or just remove the code I mentioned above, and library users can do what they want.

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