valid-error.js 169 B

12345678
  1. 'use strict';
  2. var isError = require('./is-error');
  3. module.exports = function (x) {
  4. if (!isError(x)) throw new TypeError(x + " is not an Error object");
  5. return x;
  6. };