js.spec
js.spec copied to clipboard
map spec is too strict with object definition
I'm using map() to spec classes that have fields but I am getting rejected because it eventually uses lodash's isPlainObject() does not like my class instance. I tracked it down to some deep inspection of the value's prototype constructor therein that is rejecting my instance.
I'd like to suggest that we change to use lodash isObjectLike() instead. It is simpler and rejects functions as objects. It will accept arrays as objects, and if that is a problem then adding in a test for isArray could allow the object spec to be strict in that regard.