lib/index.js
function expose(anchor, name, message) {
  Object.defineProperty(errors[anchor], name, {
    enumerable: true,
    get: function() {
      var err = new Error();

      err.name = capitalize(anchor) + 'Error';
      err.message = message;
      Error.captureStackTrace(err, arguments.callee);
      return err;
    }
  });
}
function expose(anchor, name, message) {
  Object.defineProperty(errors[anchor], name, {
    enumerable: true,
    get: function() {
      var err = new Error();

      err.name = capitalize(anchor) + 'Error';
      err.message = message;
      Error.captureStackTrace(err, arguments.callee);
      return err;
    }
  });
}
function expose ( anchor , name , message ) { Object . defineProperty ( errors [ anchor ] , name , { enumerable : true , get : function ( ) { var err = new Error ( ) ; err . name = capitalize ( anchor ) + 'Error' ; err . message = message ; Error . captureStackTrace ( err , arguments . callee ) ; return err ; } } ) ; }
Helper function for exposing errors,
also edits the stack trace to remove itself.

@param {Object} anchor
@param {String} name
@param {String} message
Helper function for exposing errors also edits the stack trace to remove itself .