Skip to content

Cannot pick value from object if key contains dot #37

@thierry2015

Description

@thierry2015

As a developer, I want to be able to pick a value from an object if the key contains dots.

// Node JS: 12.5.0
const dot = require('dot-object');

test('Can pick value with dotted key', () => {
    const object = { 'foo.bar': 'baz' };
    expect(dot.pick('foo.bar', object)).toBe('baz');
});

Currently, I am receiving undefined instead of baz.

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