react-cimpress-comment
Advanced tools
Comparing version 0.5.1 to 0.5.2
@@ -13,8 +13,2 @@ 'use strict'; | ||
var _httpErrors = require('http-errors'); | ||
var createError = _interopRequireWildcard(_httpErrors); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -51,5 +45,5 @@ | ||
} else if (response.status === 401) { | ||
throw createError.Unauthorized(); | ||
throw new Error('Unauthorized'); | ||
} else if (response.status === 403) { | ||
throw createError.Forbidden(); | ||
throw new Error('Forbidden'); | ||
} else { | ||
@@ -76,5 +70,5 @@ throw new Error('Unable to fetch comment: ' + _this2.commentUri + ' (Status code: ' + response.status + ')'); | ||
} else if (response.status === 401) { | ||
throw createError.Unauthorized(); | ||
throw new Error('Unauthorized'); | ||
} else if (response.status === 403) { | ||
throw createError.Forbidden(); | ||
throw new Error('Forbidden'); | ||
} else { | ||
@@ -81,0 +75,0 @@ throw new Error('Unable to update comment: ' + _this3.commentUri + ' (Status code: ' + response.status + ')'); |
@@ -13,8 +13,2 @@ 'use strict'; | ||
var _httpErrors = require('http-errors'); | ||
var createError = _interopRequireWildcard(_httpErrors); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -71,5 +65,5 @@ | ||
} else if (response.status === 401) { | ||
throw createError.Unauthorized(); | ||
throw new Error('Unauthorized'); | ||
} else if (response.status === 403) { | ||
throw createError.Forbidden(); | ||
throw new Error('Forbidden'); | ||
} else if (response.status === 404) { | ||
@@ -99,5 +93,5 @@ return _this2.createResource().then(function (responseJson) { | ||
} else if (response.status === 401) { | ||
throw createError.Unauthorized(); | ||
throw new Error('Unauthorized'); | ||
} else if (response.status === 403) { | ||
throw createError.Forbidden(); | ||
throw new Error('Forbidden'); | ||
} else { | ||
@@ -120,9 +114,8 @@ throw new Error('Unable to create resource (Status code: ' + response.status + ')'); | ||
return fetch(url, init).then(function (response) { | ||
throw createError.Forbidden(); | ||
if (response.status === 201) { | ||
return response.json(); | ||
} else if (response.status === 401) { | ||
throw createError.Unauthorized(); | ||
throw new Error('Unauthorized'); | ||
} else if (response.status === 403) { | ||
throw createError.Forbidden(); | ||
throw new Error('Forbidden'); | ||
} else { | ||
@@ -129,0 +122,0 @@ throw new Error('Unable to create comment for: ' + _this3.resourceUri + ' Status code: ' + response.status + ')'); |
{ | ||
"name": "react-cimpress-comment", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "Visualizes comment(s) for a particular platform resource", | ||
@@ -54,3 +54,2 @@ "main": "./lib/index.js", | ||
"deepmerge": "^2.1.1", | ||
"http-errors": "^1.6.3", | ||
"i18next": "^11.3.2", | ||
@@ -57,0 +56,0 @@ "react-i18next": "^7.6.1", |
Sorry, the diff of this file is not supported yet
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
12
9
122237
2280
+ Addedua-parser-js@0.7.40(transitive)
- Removedhttp-errors@^1.6.3
- Removeddepd@1.1.2(transitive)
- Removedhttp-errors@1.8.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedstatuses@1.5.0(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedua-parser-js@0.7.39(transitive)