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

apicase-adapter-fetch

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apicase-adapter-fetch - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

36

index.js

@@ -19,4 +19,30 @@ var pathToRegexp = require('path-to-regexp')

return fetch(ctx.payload.url, ctx.payload.options)
.then(ctx.resolve)
.catch(ctx.reject)
.then(function(res) {
return res[ctx.payload.parser]().then(function (data) {
ctx.resolve({
success: ctx.payload.validateStatus(res.status),
data: response.body,
error: null,
status: res.status,
statusText: res.statusText
})
}).catch(function (error) {
ctx.reject({
success: false,
data: response.body,
error: error,
status: res.status,
statusText: res.statusText
})
})
})
.catch(function (error) {
ctx.reject({
success: false,
data: null,
error: error,
status: null,
statusText: null
})
)
},

@@ -26,2 +52,8 @@ convert(payload) {

url: compilePath(payload.url, payload.params || {}),
parser: payload.parser || 'json',
validateStatus:
payload.validateStatus ||
function(status) {
return status >= 200 && status < 300
},
options: {

@@ -28,0 +60,0 @@ method: payload.method || 'GET',

2

package.json
{
"name": "apicase-adapter-fetch",
"version": "0.2.1",
"version": "0.2.2",
"description": "Fetch adapter for Apicase",

@@ -5,0 +5,0 @@ "main": "index.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