Skip to content

Commit

Permalink
chore: merge upstream/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Nov 13, 2020
2 parents 6947fcd + d9324b7 commit 78da3c5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 36 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [4.0.1](https://github.com/ipfs/js-ipfs-utils/compare/v4.0.0...v4.0.1) (2020-11-09)


### Bug Fixes

* fetch takes a string, not a URL ([#75](https://github.com/ipfs/js-ipfs-utils/issues/75)) ([15576b2](https://github.com/ipfs/js-ipfs-utils/commit/15576b28495caee7410fda51d8cb5aa2c8e6d106)), closes [#74](https://github.com/ipfs/js-ipfs-utils/issues/74)



<a name="4.0.0"></a>
# [4.0.0](https://github.com/ipfs/js-ipfs-utils/compare/v3.0.0...v4.0.0) (2020-10-10)

Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ipfs-utils",
"version": "4.0.0",
"version": "4.0.1",
"description": "Package to aggregate shared logic and dependencies for the IPFS ecosystem",
"main": "src/index.js",
"author": "Hugo Dias <hugomrdias@gmail.com>",
Expand Down Expand Up @@ -35,15 +35,15 @@
},
"license": "MIT",
"dependencies": {
"@achingbrain/electron-fetch": "^1.7.2",
"abort-controller": "^3.0.0",
"any-signal": "^2.1.0",
"buffer": "^5.6.0",
"@achingbrain/electron-fetch": "^1.7.2",
"buffer": "^6.0.1",
"err-code": "^2.0.0",
"fs-extra": "^9.0.1",
"is-electron": "^2.2.0",
"iso-url": "^0.4.7",
"it-glob": "0.0.8",
"iso-url": "^1.0.0",
"it-glob": "0.0.10",
"merge-options": "^2.0.0",
"nanoid": "^3.1.3",
"native-abort-controller": "0.0.3",
Expand All @@ -53,7 +53,7 @@
"it-to-stream": "^0.1.2"
},
"devDependencies": {
"aegir": "^25.0.0",
"aegir": "^28.1.0",
"delay": "^4.3.0",
"it-all": "^1.0.2",
"it-drain": "^1.0.1",
Expand All @@ -66,7 +66,8 @@
"Alan Shaw <alan.shaw@protocol.ai>",
"Hector Sanjuan <code@hector.link>",
"Irakli Gozalishvili <contact@gozala.io>",
"bluelovers <codelovers@users.sourceforge.net>",
"Marcin Rataj <lidel@lidel.org>",
"bluelovers <codelovers@users.sourceforge.net>"
"Roderik van der Veer <roderik@settlemint.com>"
]
}
28 changes: 14 additions & 14 deletions src/files/glob-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ const Path = require('path')
const errCode = require('err-code')

/**
* Create an async iterator that yields paths that match requested file paths.
*
* @param {Iterable|AsyncIterable|String} paths File system path(s) to glob from
* @param {Object} [options] Optional options
* @param {Boolean} [options.recursive] Recursively glob all paths in directories
* @param {Boolean} [options.hidden] Include .dot files in matched paths
* @param {Array<String>} [options.ignore] Glob paths to ignore
* @param {Boolean} [options.followSymlinks] follow symlinks
* @param {Boolean} [options.preserveMode] preserve mode
* @param {Boolean} [options.preserveMtime] preserve mtime
* @param {Boolean} [options.mode] mode to use - if preserveMode is true this will be ignored
* @param {Boolean} [options.mtime] mtime to use - if preserveMtime is true this will be ignored
* @yields {Object} File objects in the form `{ path: String, content: AsyncIterator<Buffer> }`
*/
* Create an async iterator that yields paths that match requested file paths.
*
* @param {Iterable | AsyncIterable | string} paths - File system path(s) to glob from
* @param {Object} [options] - Optional options
* @param {boolean} [options.recursive] - Recursively glob all paths in directories
* @param {boolean} [options.hidden] - Include .dot files in matched paths
* @param {Array<string>} [options.ignore] - Glob paths to ignore
* @param {boolean} [options.followSymlinks] - follow symlinks
* @param {boolean} [options.preserveMode] - preserve mode
* @param {boolean} [options.preserveMtime] - preserve mtime
* @param {boolean} [options.mode] - mode to use - if preserveMode is true this will be ignored
* @param {boolean} [options.mtime] - mtime to use - if preserveMtime is true this will be ignored
* @yields {Object} File objects in the form `{ path: String, content: AsyncIterator<Buffer> }`
*/
module.exports = async function * globSource (paths, options) {
options = options || {}

Expand Down
30 changes: 15 additions & 15 deletions src/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ const defaults = {

/**
* @typedef {Object} APIOptions - creates a new type named 'SpecialType'
* @prop {any} [body] - Request body
* @prop {Object} [json] - JSON shortcut
* @prop {string} [method] - GET, POST, PUT, DELETE, etc.
* @prop {string} [base] - The base URL to use in case url is a relative URL
* @prop {Headers|Record<string, string>} [headers] - Request header.
* @prop {number} [timeout] - Amount of time until request should timeout in ms.
* @prop {AbortSignal} [signal] - Signal to abort the request.
* @prop {URLSearchParams|Object} [searchParams] - URL search param.
* @prop {string} [credentials]
* @prop {boolean} [throwHttpErrors]
* @prop {function(URLSearchParams): URLSearchParams } [transformSearchParams]
* @prop {function(any): any} [transform] - When iterating the response body, transform each chunk with this function.
* @prop {function(Response): Promise<void>} [handleError] - Handle errors
* @prop {function({total:number, loaded:number, lengthComputable:boolean}):void} [onUploadProgress] - Can be passed to track upload progress.
* @property {any} [body] - Request body
* @property {Object} [json] - JSON shortcut
* @property {string} [method] - GET, POST, PUT, DELETE, etc.
* @property {string} [base] - The base URL to use in case url is a relative URL
* @property {Headers|Record<string, string>} [headers] - Request header.
* @property {number} [timeout] - Amount of time until request should timeout in ms.
* @property {AbortSignal} [signal] - Signal to abort the request.
* @property {URLSearchParams|Object} [searchParams] - URL search param.
* @property {string} [credentials]
* @property {boolean} [throwHttpErrors]
* @property {function(URLSearchParams): URLSearchParams } [transformSearchParams]
* @property {function(any): any} [transform] - When iterating the response body, transform each chunk with this function.
* @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.
*/

Expand Down Expand Up @@ -129,7 +129,7 @@ class HTTP {
const abortController = new AbortController()
const signal = anySignal([abortController.signal, opts.signal])

const response = await timeout(fetch(url, {
const response = await timeout(fetch(url.toString(), {
...opts,
signal,
timeout: undefined
Expand Down

0 comments on commit 78da3c5

Please sign in to comment.