Socket
Socket
Sign inDemoInstall

minipass-fetch

Package Overview
Dependencies
7
Maintainers
6
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.0 to 2.1.1

24

lib/body.js

@@ -13,3 +13,5 @@ 'use strict'

convert = require('encoding').convert
} catch (e) {}
} catch (e) {
// defer error until textConverted is called
}

@@ -73,12 +75,12 @@ const INTERNALS = Symbol('Body internals')

json () {
return this[CONSUME_BODY]().then(buf => {
try {
return JSON.parse(buf.toString())
} catch (er) {
return Promise.reject(new FetchError(
`invalid json response body at ${
this.url} reason: ${er.message}`, 'invalid-json'))
}
})
async json () {
try {
const buf = await this[CONSUME_BODY]()
return JSON.parse(buf.toString())
} catch (er) {
throw new FetchError(
`invalid json response body at ${this.url} reason: ${er.message}`,
'invalid-json'
)
}
}

@@ -85,0 +87,0 @@

{
"name": "minipass-fetch",
"version": "2.1.0",
"version": "2.1.1",
"description": "An implementation of window.fetch in Node.js using Minipass streams",

@@ -26,6 +26,7 @@ "license": "MIT",

"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "3.1.2",
"@npmcli/template-oss": "3.5.0",
"@ungap/url-search-params": "^0.2.2",
"abort-controller": "^3.0.0",
"abortcontroller-polyfill": "~1.7.3",
"encoding": "^0.1.13",
"form-data": "^4.0.0",

@@ -65,4 +66,4 @@ "nock": "^13.2.4",

"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.1.2"
"version": "3.5.0"
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc