deepSet where path leading up to key contains non-objects
nucleartide opened this issue · comments
Jason Tu commented
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.
lauren commented
I think that should be handled here instead. Added you as a collaborator. Thanks for finding this issue!