Socket
Socket
Sign inDemoInstall

ipfs-utils

Package Overview
Dependencies
Maintainers
3
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipfs-utils - npm Package Compare versions

Comparing version 4.0.1 to 5.0.0

src/http/error.js

9

CHANGELOG.md

@@ -0,1 +1,10 @@

# [5.0.0](https://github.com/ipfs/js-ipfs-utils/compare/v4.0.1...v5.0.0) (2020-11-16)
### Features
* add onUploadProgress handler ([#60](https://github.com/ipfs/js-ipfs-utils/issues/60)) ([a2e88e2](https://github.com/ipfs/js-ipfs-utils/commit/a2e88e23f16bd0da57a67c02e8c875a2705bb28f))
## [4.0.1](https://github.com/ipfs/js-ipfs-utils/compare/v4.0.0...v4.0.1) (2020-11-09)

@@ -2,0 +11,0 @@

8

package.json
{
"name": "ipfs-utils",
"version": "4.0.1",
"version": "5.0.0",
"description": "Package to aggregate shared logic and dependencies for the IPFS ecosystem",

@@ -15,2 +15,3 @@ "main": "src/index.js",

"browser": {
"./src/http/fetch.js": "./src/http/fetch.browser.js",
"./src/text-encoder.js": "./src/text-encoder.browser.js",

@@ -52,3 +53,4 @@ "./src/text-decoder.js": "./src/text-decoder.browser.js",

"node-fetch": "^2.6.0",
"stream-to-it": "^0.2.0"
"stream-to-it": "^0.2.0",
"it-to-stream": "^0.1.2"
},

@@ -61,3 +63,3 @@ "devDependencies": {

"it-last": "^1.0.2",
"it-to-stream": "^0.1.2"
"uint8arrays": "^1.1.0"
},

@@ -64,0 +66,0 @@ "contributors": [

/* eslint-disable no-undef */
'use strict'
const {
default: fetch,
Request,
Headers
} = require('./fetch')
const { fetch, Request, Headers } = require('./http/fetch')
const { TimeoutError, HTTPError } = require('./http/error')
const merge = require('merge-options').bind({ ignoreUndefined: true })

@@ -15,17 +12,2 @@ const { URL, URLSearchParams } = require('iso-url')

class TimeoutError extends Error {
constructor () {
super('Request timed out')
this.name = 'TimeoutError'
}
}
class HTTPError extends Error {
constructor (response) {
super(response.statusText)
this.name = 'HTTPError'
this.response = response
}
}
const timeout = (promise, ms, abortController) => {

@@ -92,2 +74,4 @@ if (ms === undefined) {

* @property {function(Response): Promise<void>} [handleError] - Handle errors
* @property {function({total:number, loaded:number, lengthComputable:boolean}):void} [onUploadProgress] - Can be passed to track upload progress.
* Note that if this option in passed underlying request will be performed using `XMLHttpRequest` and response will not be streamed.
*/

@@ -94,0 +78,0 @@

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