New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wonderful-fetch

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wonderful-fetch - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

51

dist/index.js

@@ -23,3 +23,3 @@ (function (root, factory) {

var SOURCE = 'library';
var VERSION = '0.0.3';
var VERSION = '0.0.4';

@@ -126,26 +126,31 @@ function WonderfulFetch(url, options) {

} else {
res.text()
.then(function (text) {
if (res.ok) {
if (options.raw) {
return _resolve(res);
} else if (options.json) {
JSON5 = JSON5 || require('json5');
try {
return _resolve(JSON5.parse(text));
} catch (e) {
throw new Error(new Error('Response is not JSON: ' + e))
if (res.ok) {
if (options.raw) {
return _resolve(res);
} else {
res.text()
.then(function (text) {
if (options.json) {
JSON5 = JSON5 || require('json5');
try {
return _resolve(JSON5.parse(text));
} catch (e) {
throw new Error(new Error('Response is not JSON: ' + e))
}
} else {
return _resolve(text);
}
} else {
return _resolve(text);
}
} else {
var error = new Error(text || res.statusText || 'Unknown error');
Object.assign(error, { status: res.status })
throw error;
})
}
})
.catch(e => {
return _reject(e);
})
} else {
res.text()
.then(function (text) {
var error = new Error(text || res.statusText || 'Unknown error');
Object.assign(error, { status: res.status })
throw error;
})
.catch(e => {
return _reject(e);
})
}
}

@@ -152,0 +157,0 @@ })

{
"name": "wonderful-fetch",
"version": "0.0.3",
"version": "0.0.4",
"description": "A wrapper around fetch.",

@@ -35,2 +35,2 @@ "main": "./dist/index.js",

"runkitExampleFilename": "examples/process.js"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc