create-error
create-error copied to clipboard
clone() throws on props set to objects not prototypically extended from Object
Specifically wanted to use the return of querystring
.parse() to save the response of an api call to a prop on my custom error. Took awhile to figure out that qs.parse() doesn't return a fully extended Object >.>
TypeError: target.hasOwnProperty is not a function at clone (...\node_modules\create-error\create-error.js:94:16) at attachProps (...\node_modules\create-error\create-error.js:82:26) at new ErrorCtor (...\node_modules\create-error\create-error.js:28:5)
Can we maybe just change create-error.js#L94 to if (Object.prototype.hasOwnProperty(target, attr))
?