jonschlinkert / merge-deep

Recursively merge values in a JavaScript object.

Home Page:https://github.com/jonschlinkert

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Properties containing functions aren't replaced like numbers and other data types

guiprav opened this issue · comments

  • OS: Debian 9.
  • Node version: 6.3.1.
  • Library version: 3.0.0.

Why should properties containing functions behave differently from, say, numbers?

  • Consider: mergeDeep({ a: () => 1, b: () => 2 }, { b: () => 3, c: () => 4 }).b()
  • Expected: 3
  • Got: 2

vs.

  • Consider: mergeDeep({ a: 1, b: 2 }, { b: 3, c: 4 }).b
  • Expected: 3
  • Got: 3

Should the title say something about "expected result?" or do you want to show where specifically the code is "handling something" improperly?

Was the comparison between the behavior of a property containing a function vs a number unclear?