Socket
Socket
Sign inDemoInstall

@aspida/node-fetch

Package Overview
Dependencies
24
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.4.0 to 1.4.1

2

dist/index.js

@@ -72,4 +72,6 @@ "use strict";

function HTTPError(response) {
var _newTarget = this.constructor;
var _this = _super.call(this, "HTTP Error: " + response.status + " " + response.statusText) || this;
_this.response = response;
Object.setPrototypeOf(_this, _newTarget.prototype);
return _this;

@@ -76,0 +78,0 @@ }

4

package.json
{
"name": "@aspida/node-fetch",
"version": "1.4.0",
"version": "1.4.1",
"description": "node-fetch client for aspida",

@@ -29,4 +29,4 @@ "author": "Solufa <solufa2020@gmail.com>",

"dependencies": {
"aspida": "^1.4.0"
"aspida": "^1.4.1"
}
}

@@ -53,3 +53,7 @@ # @aspida/node-fetch

const fetchConfig = { baseURL: "https://example.com/api" }
const fetchConfig = {
baseURL: "https://example.com/api",
throwHttpErrors: true // throw an error on 4xx/5xx, default is false
}
const client = api(aspida(fetch, fetchConfig))

@@ -72,3 +76,3 @@ ;(async () => {

// res -> { id: 0, name: "mario" }
} catch (e: HTTPError | Error) {
} catch (e) {
if (e instanceof HTTPError) {

@@ -75,0 +79,0 @@ console.log(e.response instanceof Response) // true

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc