Skip to content

fix(reducer): allow setting paths ending in numbers #248

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

Merged

Conversation

levithomason
Copy link

@levithomason levithomason commented Aug 23, 2017

Fixes #228, tests added

_.set does not respect numeric object keys. Use _.setWith instead:

const path = getDotStrPath('/analyses/123')  // => 'analyses.123'

_.set(path, { data: true }, {})              // => { analyses: [ undefined x 123 ] }

_.setWith(Object, path, { data: true }, {})  // => { analyses: { 123: { data: true } } }

There are many lodash issues and SO posts about this bizarre design decision but it looks like it is not likely to be changed.

@levithomason levithomason changed the base branch from master to v2.0.0 August 23, 2017 18:29
@prescottprue prescottprue changed the base branch from v2.0.0 to v2.0.0-beta.7 August 23, 2017 19:33
@prescottprue prescottprue merged commit 3477ced into prescottprue:v2.0.0-beta.7 Aug 23, 2017
@prescottprue prescottprue mentioned this pull request Aug 24, 2017
3 tasks
@levithomason levithomason deleted the fix/set-path-number branch August 24, 2017 04:16
prescottprue added a commit that referenced this pull request Aug 24, 2017
* fix(reducer): allow setting paths ending in numbers - #248
* feat(auth): make signInWithCredential not dependent on provider - #247
* `signInWithCustomToken` no longer decodes token internally for profile data (`profileFactory` should be used) - #244
* Removed `jwt-decode` as a dependency (not needed since auth token no longer decoded internally)
* Support lazy/module loading - #249, #250 
* Updated SSR docs to include notes about `enableRedirectHanlding: false` - #251
* Updated Roadmap with detection of non-http environments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants