lodash
lodash copied to clipboard
Argument Mutation in flatSpread
Issue: Using Object(name) as a check to see if name is an object is not reliable since it could fail for various falsy or primitive values. Instead, use a more reliable check here.
This library literally contains an isObject function. Why is that not being used here??
x === Object(x) is utterly reliable in every JavaScript engine since its creation, and is an "isObject" replacement.
Additionally, that does not mutate x, it createst a new object wrapping x iff it's a primitive.