@marcopeg/utils
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -167,4 +167,2 @@ 'use strict'; | ||
}); | ||
console.log('headers', headers); | ||
options = Object.assign({}, config, { | ||
@@ -175,12 +173,10 @@ method: 'POST', | ||
}); | ||
console.log('options', options); | ||
_context3.next = 7; | ||
_context3.next = 5; | ||
return wrappedFetch(url, options); | ||
case 7: | ||
case 5: | ||
res = _context3.sent; | ||
if (!(res.status !== 200)) { | ||
_context3.next = 22; | ||
_context3.next = 20; | ||
break; | ||
@@ -190,18 +186,18 @@ } | ||
errMsg = void 0; | ||
_context3.prev = 10; | ||
_context3.next = 13; | ||
_context3.prev = 8; | ||
_context3.next = 11; | ||
return res.text(); | ||
case 13: | ||
case 11: | ||
errMsg = _context3.sent; | ||
_context3.next = 19; | ||
_context3.next = 17; | ||
break; | ||
case 16: | ||
_context3.prev = 16; | ||
_context3.t0 = _context3['catch'](10); | ||
case 14: | ||
_context3.prev = 14; | ||
_context3.t0 = _context3['catch'](8); | ||
errMsg = res.statusText; | ||
case 19: | ||
case 17: | ||
error = new Error(res.status + ' - ' + errMsg); | ||
@@ -212,15 +208,15 @@ | ||
case 22: | ||
_context3.next = 24; | ||
case 20: | ||
_context3.next = 22; | ||
return res.json(); | ||
case 24: | ||
case 22: | ||
return _context3.abrupt('return', _context3.sent); | ||
case 27: | ||
_context3.prev = 27; | ||
case 25: | ||
_context3.prev = 25; | ||
_context3.t1 = _context3['catch'](0); | ||
throw _context3.t1; | ||
case 30: | ||
case 28: | ||
case 'end': | ||
@@ -230,3 +226,3 @@ return _context3.stop(); | ||
} | ||
}, _callee3, undefined, [[0, 27], [10, 16]]); | ||
}, _callee3, undefined, [[0, 25], [8, 14]]); | ||
})); | ||
@@ -345,7 +341,7 @@ | ||
wrappedFetch.getJSONAuth = getJSONAuth; | ||
wrappedFetch.postJSON = postJSON; | ||
wrappedFetch.postJSONAuth = postJSONAuth; | ||
wrappedFetch.postJSONAuth = postJSONAuth; | ||
wrappedFetch.putJSON = putJSON; | ||
wrappedFetch.putJSONAuth = putJSONAuth; | ||
wrappedFetch.putJSONAuth = putJSONAuth; | ||
module.exports = wrappedFetch; |
{ | ||
"name": "@marcopeg/utils", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "Javascript utils for server and client projects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -73,3 +73,2 @@ /* global fetch */ | ||
}) | ||
console.log('headers', headers) | ||
const options = Object.assign({}, config, { | ||
@@ -80,3 +79,2 @@ method: 'POST', | ||
}) | ||
console.log('options', options) | ||
const res = await wrappedFetch(url, options) | ||
@@ -160,7 +158,7 @@ | ||
wrappedFetch.getJSONAuth = getJSONAuth | ||
wrappedFetch.postJSON = postJSON | ||
wrappedFetch.postJSONAuth = postJSONAuth | ||
wrappedFetch.postJSONAuth = postJSONAuth | ||
wrappedFetch.putJSON = putJSON | ||
wrappedFetch.putJSONAuth = putJSONAuth | ||
wrappedFetch.putJSONAuth = putJSONAuth | ||
module.exports = wrappedFetch |
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
73233
591