lodash/lodash-webpack-plugin

Using _.find

JeffreyArts opened this issue · 2 comments

Hi,

What happens with the lodash find function with this package? Since it throws the following error when I try to use it predicate is not a function.

When I change the webpack configuration by adding "shorthands": true, it does not throw the error anymore. But doesn't seem to work as it should neither, since the result is undefined.

When I log the values before the _.find function call in my script, and use those values in the console on the same page it threw me the error before. It works as it should, and gives the expected result.

Would like to know what the shorthands parameter actually stands for as well, that isn't really clear to me :-)

You'll need to enable the "shorthands" feature set if you want to pass anything other than a function predicate. I don't recommend that however because "shorthands" is an expensive (as in file size) feature set.

I got this problem as well.

_.find(a, ['c', 5]) returns undefined, without throwing any error, and with shorthands: true in the config.