js.spec icon indicating copy to clipboard operation
js.spec copied to clipboard

map spec is too strict with object definition

Open mattbishop opened this issue 7 years ago • 0 comments

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.

mattbishop avatar Dec 04 '17 01:12 mattbishop