8000 Lodash 4.17.0 _.pick breaks when there are dots in keys · Issue #2809 · lodash/lodash · GitHub
[go: up one dir, main page]

Skip to content

Lodash 4.17.0 _.pick breaks when there are dots in keys #2809

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
jvah opened this issue Nov 14, 2016 · 2 comments
Closed

Lodash 4.17.0 _.pick breaks when there are dots in keys #2809

jvah opened this issue Nov 14, 2016 · 2 comments
Labels

Comments

@jvah
Copy link
jvah commented Nov 14, 2016

With lodash 4.16.6:

> _.pick({'foo.txt': 'foo', 'bar.txt': 'bar', 'baz.txt': 'baz'}, ['foo.txt', 'baz.txt'])
{ 'foo.txt': 'foo', 'baz.txt': 'baz' }

With lodash 4.17.0:

> _.pick({'foo.txt': 'foo', 'bar.txt': 'bar', 'baz.txt': 'baz'}, ['foo.txt', 'baz.txt'])
{ foo: { txt: 'foo' }, baz: { txt: 'baz' } }
@jdalton
Copy link
Member
jdalton commented Nov 14, 2016

Hi @jvah!

This is partially by design. See #723.
I've patched _.pick to allow specifying array paths like:

_.pick({'foo.txt': 'foo', 'bar.txt': 'bar', 'baz.txt': 'baz'}, [['foo.txt'], ['baz.txt']])
// => { 'foo.txt': 'foo', 'baz.txt': 'baz' }

I'll have a v4.17.1 patch release out sometime today.

@jdalton jdalton closed this as completed Nov 14, 2016
@jdalton jdalton added bug and removed invalid labels Nov 14, 2016
@lodash lodash locked and limited conversation to collaborators Nov 14, 2016
@jdalton
Copy link
Member
jdalton commented Nov 15, 2016

@jvah

I've addressed this issue with #2826 so you won't have to use the an array escape for your use case.
I'll have a v4.17.2 patch release out sometime today.

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