marklagendijk/lodash-deep

Property path as Object

Closed this issue · 2 comments

dvdln commented

How do you feel about letting propertyPath be an Object?

// Source Object
var collection = {
  foo: {
    bar: {
      baz: 'qux',
      asdf: 'qwerty'
    }
  }
};

_.deepGet(collection, {
  foo: {
    bar: {
      baz: 'localBazName',
      asdf: 'localAsdfName',
      wat: 'localWatName'
    }
  }
});

Result:

{
  "localBazName": "qux",
  "localAsdfName": "qwerty",
  "wat": undefined
}

I don't think this makes much sense. If you would want this you could write your own mixin to support this.

dvdln commented

Yeah, that's essentially what I did. Thanks!