Skip to content

Commit

Permalink
chore: update buffer deps (#3607)
Browse files Browse the repository at this point in the history
Updates deps to pull in Buffer@6.x.x

Refs #3604
Fixes #3389

Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
  • Loading branch information
achingbrain and vasco-santos authored Apr 27, 2021
1 parent 74e1b73 commit 1a4df0b
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const getPort = require('aegir/utils/get-port')
/** @type {import('aegir').PartialOptions} */
module.exports = {
build: {
bundlesizeMax: '106kB'
bundlesizeMax: '96KB'
},
test: {
async before (options) {
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"form-data": "^4.0.0",
"ipfs-core-types": "^0.3.1",
"ipfs-core-utils": "^0.7.2",
"ipfs-unixfs": "^4.0.1",
"ipfs-unixfs": "^4.0.3",
"ipfs-utils": "^6.0.4",
"ipld": "^0.29.0",
"ipld-block": "^0.11.0",
Expand All @@ -60,26 +60,26 @@
"ipld-raw": "^7.0.0",
"it-last": "^1.0.4",
"it-map": "^1.0.4",
"it-tar": "^1.2.2",
"it-to-stream": "^0.1.2",
"it-tar": "^3.0.0",
"it-to-stream": "^1.0.0",
"merge-options": "^3.0.4",
"multiaddr": "^8.0.0",
"multiaddr": "^9.0.1",
"multibase": "^4.0.2",
"multicodec": "^3.0.1",
"multihashes": "^4.0.2",
"nanoid": "^3.1.12",
"native-abort-controller": "^1.0.3",
"parse-duration": "^0.4.4",
"parse-duration": "^1.0.0",
"stream-to-it": "^0.2.2",
"uint8arrays": "^2.1.3"
},
"devDependencies": {
"aegir": "^32.1.0",
"aegir": "^33.0.0",
"delay": "^5.0.0",
"go-ipfs": "0.8.0",
"ipfsd-ctl": "^8.0.0",
"ipfsd-ctl": "^8.0.1",
"it-all": "^1.0.4",
"it-concat": "^1.0.3",
"it-concat": "^2.0.0",
"it-first": "^1.0.4",
"nock": "^13.0.2",
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const Multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')

/**
* @typedef {import('../types').HTTPClientExtraOptions} HTTPClientExtraOptions
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/clear.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const Multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')

/**
* @typedef {import('../types').HTTPClientExtraOptions} HTTPClientExtraOptions
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const Multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')

/**
* @typedef {import('../types').HTTPClientExtraOptions} HTTPClientExtraOptions
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const Multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')

/**
* @typedef {import('../types').HTTPClientExtraOptions} HTTPClientExtraOptions
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/rm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const Multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')

/**
* @typedef {import('../types').HTTPClientExtraOptions} HTTPClientExtraOptions
Expand Down
4 changes: 2 additions & 2 deletions src/dht/find-peer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const CID = require('cids')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const { FinalPeer } = require('./response-types')
Expand Down Expand Up @@ -31,7 +31,7 @@ module.exports = configure(api => {
const { ID, Addrs } = data.Responses[0]
return {
id: ID,
addrs: (Addrs || []).map((/** @type {string} **/ a) => multiaddr(a))
addrs: (Addrs || []).map((/** @type {string} **/ a) => new Multiaddr(a))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/dht/find-provs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const CID = require('cids')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const { Provider } = require('./response-types')
Expand Down Expand Up @@ -31,7 +31,7 @@ module.exports = configure(api => {
for (const { ID, Addrs } of message.Responses) {
yield {
id: ID,
addrs: (Addrs || []).map((/** @type {string} **/ a) => multiaddr(a))
addrs: (Addrs || []).map((/** @type {string} **/ a) => new Multiaddr(a))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/dht/provide.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const CID = require('cids')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const toCamel = require('../lib/object-to-camel')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
Expand Down Expand Up @@ -34,7 +34,7 @@ module.exports = configure(api => {
if (message.responses) {
message.responses = message.responses.map((/** @type {{ ID: string, Addrs: string[] }} */ { ID, Addrs }) => ({
id: ID,
addrs: (Addrs || []).map((/** @type {string} **/ a) => multiaddr(a))
addrs: (Addrs || []).map((/** @type {string} **/ a) => new Multiaddr(a))
}))
} else {
message.responses = []
Expand Down
4 changes: 2 additions & 2 deletions src/dht/put.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const CID = require('cids')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const toCamel = require('../lib/object-to-camel')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
Expand Down Expand Up @@ -42,7 +42,7 @@ module.exports = configure(api => {
if (message.responses) {
message.responses = message.responses.map((/** @type {{ ID: string, Addrs: string[] }} */ { ID, Addrs }) => ({
id: ID,
addrs: (Addrs || []).map(a => multiaddr(a))
addrs: (Addrs || []).map(a => new Multiaddr(a))
}))
}
yield message
Expand Down
4 changes: 2 additions & 2 deletions src/dht/query.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const CID = require('cids')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const toCamel = require('../lib/object-to-camel')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
Expand Down Expand Up @@ -31,7 +31,7 @@ module.exports = configure(api => {
message.id = new CID(message.id)
message.responses = (message.responses || []).map((/** @type {{ ID: string, Addrs: string[] }} */ { ID, Addrs }) => ({
id: ID,
addrs: (Addrs || []).map((/** @type {string} **/ a) => multiaddr(a))
addrs: (Addrs || []).map((/** @type {string} **/ a) => new Multiaddr(a))
}))
yield message
}
Expand Down
4 changes: 2 additions & 2 deletions src/id.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const toCamel = require('./lib/object-to-camel')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const configure = require('./lib/configure')
const toUrlSearchParams = require('./lib/to-url-search-params')

Expand All @@ -28,7 +28,7 @@ module.exports = configure(api => {
}

if (output.addresses) {
output.addresses = output.addresses.map((/** @type {string} */ ma) => multiaddr(ma))
output.addresses = output.addresses.map((/** @type {string} */ ma) => new Multiaddr(ma))
}

// @ts-ignore server output is not typed
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-env browser */

const CID = require('cids')
const multiaddr = require('multiaddr')
const { multiaddr } = require('multiaddr')
const multibase = require('multibase')
const multicodec = require('multicodec')
const multihash = require('multihashes')
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'
/* eslint-env browser */
const Multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const { isBrowser, isWebWorker, isNode } = require('ipfs-utils/src/env')
const { default: parseDuration } = require('parse-duration')
const log = require('debug')('ipfs-http-client:lib:error-handler')
Expand Down
4 changes: 2 additions & 2 deletions src/swarm/addrs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')

Expand All @@ -26,7 +26,7 @@ module.exports = configure(api => {

return Object.keys(Addrs).map(id => ({
id,
addrs: (Addrs[id] || []).map(a => multiaddr(a))
addrs: (Addrs[id] || []).map(a => new Multiaddr(a))
}))
}
return addrs
Expand Down
4 changes: 2 additions & 2 deletions src/swarm/localAddrs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')

Expand All @@ -24,7 +24,7 @@ module.exports = configure(api => {
/** @type {{ Strings: string[] }} */
const { Strings } = await res.json()

return (Strings || []).map(a => multiaddr(a))
return (Strings || []).map(a => new Multiaddr(a))
}
return localAddrs
})
4 changes: 2 additions & 2 deletions src/swarm/peers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')

Expand All @@ -26,7 +26,7 @@ module.exports = configure(api => {

return (Peers || []).map(peer => {
return {
addr: multiaddr(peer.Addr),
addr: new Multiaddr(peer.Addr),
peer: peer.Peer,
muxer: peer.Muxer,
latency: peer.Latency,
Expand Down
2 changes: 1 addition & 1 deletion src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Format as IPLDFormat } from 'interface-ipld-format'
import { LoadFormatFn } from 'ipld'
import { Agent as HttpAgent } from 'http'
import { Agent as HttpsAgent } from 'https'
import Multiaddr from 'multiaddr'
import { Multiaddr } from 'multiaddr'

export interface Options {
host?: string
Expand Down
8 changes: 4 additions & 4 deletions test/constructor.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha, browser */
'use strict'

const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const { expect } = require('aegir/utils/chai')
const f = require('./utils/factory')()
const { create: ipfsClient } = require('../src/index.js')
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('ipfs-http-client constructor tests', () => {
it('multiaddr instance', () => {
const host = 'ace.place'
const port = '1001'
const addr = multiaddr(`/dns4/${host}/tcp/${port}`)
const addr = new Multiaddr(`/dns4/${host}/tcp/${port}`)
const ipfs = ipfsClient(addr)
expectConfig(ipfs, { host, port })
})
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('ipfs-http-client constructor tests', () => {
const port = '1001'
const protocol = 'http' // default to http if not specified in multiaddr
const addr = `/dns4/${host}/tcp/${port}`
const ipfs = ipfsClient({ url: multiaddr(addr) })
const ipfs = ipfsClient({ url: new Multiaddr(addr) })
expectConfig(ipfs, { host, port, protocol })
})

Expand All @@ -141,7 +141,7 @@ describe('ipfs-http-client constructor tests', () => {
const port = '1001'
const protocol = 'https'
const addr = `/dns4/${host}/tcp/${port}/https`
const ipfs = ipfsClient({ url: multiaddr(addr) })
const ipfs = ipfsClient({ url: new Multiaddr(addr) })
expectConfig(ipfs, { host, port, protocol })
})

Expand Down
2 changes: 1 addition & 1 deletion test/exports.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict'

const CID = require('cids')
const multiaddr = require('multiaddr')
const { multiaddr } = require('multiaddr')
const multibase = require('multibase')
const multicodec = require('multicodec')
const multihash = require('multihashes')
Expand Down

0 comments on commit 1a4df0b

Please sign in to comment.