poteto / ember-deep-set

Deeply set values on an Ember Object or POJO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deepSet where path leading up to key contains non-objects

nucleartide opened this issue · comments

Hey @poteto, sorry to bother you –

I'm running into this issue where I want to deepSet a key, but the path leading up to that key contains non-objects. Here's an example:

let o = { foo: 'bar' };
deepSet(o, 'foo.bar.baz', 'something'); // will currently error

Lodash's _.set implementation will overwrite the 'bar' string, and I'm thinking we could follow that behavior.

It's easy for me to work around this in ember-changeset (see here), but would you like to add this behavior to ember-deep-set as well? If not, it's no big deal.

I think that should be handled here instead. Added you as a collaborator. Thanks for finding this issue!