8000 Wrong result with `_.pickBy` in 4.17.0 · Issue #2808 · lodash/lodash · GitHub
[go: up one dir, main page]

Skip to content

Wrong result with _.pickBy in 4.17.0 #2808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
holm opened this issue Nov 14, 2016 · 1 comment
Closed

Wrong result with _.pickBy in 4.17.0 #2808

holm opened this issue Nov 14, 2016 · 1 comment
Labels

Comments

@holm
Copy link
holm commented Nov 14, 2016

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.

@jdalton jdalton added the bug label Nov 14, 2016
@jdalton
Copy link
Member
jdalton commented Nov 14, 2016

Thanks for the heads up @holm!

I've patched this (102c5f0) to avoid issues with paths containing dots or brackets.
I'll have a v4.17.1 patch release out sometime today.

@lodash lodash locked and limited conversation to collaborators Nov 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants
0