1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 1x 1x 11x | /** * Module Dependencies */ var toString = Object.prototype.toString /** * Export `isError` */ module.exports = isError /** * Check if the value is an Error * * @param {Mixed} mixed * @return {Boolean} */ function isError (mixed) { return toString.call(mixed) === '[object Error]' || mixed instanceof Error } |