YuriGor / deepdash

eachDeep, filterDeep, findDeep, someDeep, omitDeep, pickDeep, keysDeep etc.. Tree traversal library written in Underscore/Lodash fashion
https://deepdash.io/
MIT License
272 stars 12 forks source link

mapValuesDeep mutates the original object if `leavesOnly: false` #99

Closed lewisblackwood closed 3 years ago

lewisblackwood commented 3 years ago

Hi,

Great library 👍

I found using mapValuesDeep that if the options are left at the default leavesOnly: false, then it mutates the original object. If leavesOnly: true then the original object is not mutated.

You can see an example repl.it here.

// leavesOnly: true
{ sourceData: { hello: 'world' }, mappedData: { hello: 'WORLD' } }
// leavesOnly: false
{ sourceData: { hello: 'WORLD' }, mappedData: { hello: 'WORLD' } }

Is this the expected behaviour?

YuriGor commented 3 years ago

Hi, thank you for report, looks like a bug, will check in next few days.