ipfs-utils
Advanced tools
Comparing version 4.0.1 to 5.0.0
@@ -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 @@ |
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60793
29
1112
16
3
+ Addedit-to-stream@^0.1.2
+ Addedbuffer@5.7.1(transitive)
+ Addedfast-fifo@1.3.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedit-to-stream@0.1.2(transitive)
+ Addedp-defer@3.0.0(transitive)
+ Addedp-fifo@1.0.0(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)