Comparing version 2.0.0 to 2.0.1
'use strict'; | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper")); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _typeof2 = require('babel-runtime/helpers/typeof'); | ||
var _typeof3 = _interopRequireDefault(_typeof2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var humanizeString = require('humanize-string'); | ||
@@ -33,12 +25,12 @@ | ||
var errors = {}; | ||
errorDefinitions.forEach(function (errorDefinition) { | ||
var errorName = void 0; | ||
var errorCode = void 0; | ||
var errorName; | ||
var errorCode; | ||
switch (typeof errorDefinition === 'undefined' ? 'undefined' : (0, _typeof3.default)(errorDefinition)) { | ||
switch ((0, _typeof2.default)(errorDefinition)) { | ||
case 'string': | ||
errorName = errorDefinition; | ||
errorCode = 'E' + errorDefinition.toUpperCase(); | ||
errorCode = "E".concat(errorDefinition.toUpperCase()); | ||
break; | ||
case 'object': | ||
@@ -48,2 +40,3 @@ errorName = errorDefinition.name; | ||
break; | ||
default: | ||
@@ -53,12 +46,14 @@ throw new Error('Invalid error definition.'); | ||
var CustomError = function (_Error) { | ||
(0, _inherits3.default)(CustomError, _Error); | ||
var CustomError = | ||
/*#__PURE__*/ | ||
function (_Error) { | ||
(0, _inherits2.default)(CustomError, _Error); | ||
function CustomError() { | ||
var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : humanizeString(errorName) + '.'; | ||
var cause = arguments[1]; | ||
(0, _classCallCheck3.default)(this, CustomError); | ||
var _this; | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (CustomError.__proto__ || (0, _getPrototypeOf2.default)(CustomError)).call(this)); | ||
var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "".concat(humanizeString(errorName), "."); | ||
var cause = arguments.length > 1 ? arguments[1] : undefined; | ||
(0, _classCallCheck2.default)(this, CustomError); | ||
_this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(CustomError).call(this)); | ||
_this.name = errorName; | ||
@@ -72,7 +67,6 @@ _this.code = errorCode; | ||
return CustomError; | ||
}(Error); | ||
}((0, _wrapNativeSuper2.default)(Error)); | ||
errors[errorName] = CustomError; | ||
}); | ||
return errors; | ||
@@ -79,0 +73,0 @@ }; |
{ | ||
"name": "defekt", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "defekt is custom errors made simple.", | ||
@@ -21,7 +21,8 @@ "contributors": [ | ||
"dependencies": { | ||
"@babel/runtime": "7.1.5", | ||
"humanize-string": "1.0.2" | ||
}, | ||
"devDependencies": { | ||
"assertthat": "1.0.0", | ||
"roboter": "1.1.0" | ||
"assertthat": "2.0.0", | ||
"roboter": "2.2.0" | ||
}, | ||
@@ -28,0 +29,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69481
2
173
+ Added@babel/runtime@7.1.5
+ Added@babel/runtime@7.1.5(transitive)
+ Addedregenerator-runtime@0.12.1(transitive)