Skip to content

Wrong result with _.pickBy in 4.17.0 #2808

@holm

Description

@holm

In 4.17.0, _.pickBy returns unexpected results:

const _ = require('lodash');

const obj = {
  'ab.c': 'foo',
  abc: 'bar'
};

const result = _.pickBy(obj, (value, key) => key.endsWith('c'));

console.log(result);

This will print out:

{ ab: { c: 'foo' }, abc: 'bar' }

It seems the change in c6ff776 now splits it by dot, which I suspect is not intended.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions