Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit edb367a

Browse files
committed
chore: update deps & remove obsolete ignores
1 parent 88770f9 commit edb367a

File tree

31 files changed

+42
-47
lines changed

31 files changed

+42
-47
lines changed

examples/traverse-ipld-graphs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"test-ipfs-example": "^2.0.3"
1414
},
1515
"dependencies": {
16-
"cids": "^1.0.0",
16+
"cids": "^1.0.2",
1717
"ipfs": "^0.50.1",
1818
"ipld-block": "^0.10.1",
1919
"ipld-dag-pb": "^0.20.0",

packages/interface-ipfs-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"chai": "^4.2.0",
3535
"chai-as-promised": "^7.1.1",
3636
"chai-subset": "^1.6.0",
37-
"cids": "^1.0.0",
37+
"cids": "^1.0.2",
3838
"delay": "^4.4.0",
3939
"dirty-chai": "^2.0.1",
4040
"err-code": "^2.0.3",

packages/ipfs-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"bignumber.js": "^9.0.0",
3333
"byteman": "^1.3.5",
3434
"cid-tool": "^1.0.0",
35-
"cids": "^1.0.0",
35+
"cids": "^1.0.2",
3636
"debug": "^4.1.1",
3737
"dlv": "^1.1.3",
3838
"electron-webrtc": "^0.3.0",

packages/ipfs-cli/src/daemon.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ function getLibp2p ({ libp2pOptions, options, config, peerId }) {
103103
const delegateAddr = Multiaddr(delegateString).toOptions()
104104
const delegateApiOptions = {
105105
host: delegateAddr.host,
106-
// port is a string atm, so we need to convert for the check
107-
// @ts-ignore - parseInt(input:string) => number
108-
protocol: parseInt(delegateAddr.port) === 443 ? 'https' : 'http',
106+
protocol: parseInt(`${delegateAddr.port}`) === 443 ? 'https' : 'http',
109107
port: delegateAddr.port
110108
}
111109

packages/ipfs-core-utils/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"license": "MIT",
3939
"dependencies": {
4040
"blob-to-it": "0.0.2",
41-
"browser-readablestream-to-it": "0.0.2",
42-
"cids": "^1.0.0",
41+
"browser-readablestream-to-it": "^1.0.1",
42+
"cids": "^1.0.2",
4343
"err-code": "^2.0.3",
4444
"ipfs-utils": "^4.0.0",
4545
"it-all": "^1.0.4",

packages/ipfs-core-utils/src/cid.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ exports.cidToString = (input, options = {}) => {
2121
const upgrade = options.upgrade !== false
2222
let cid = CID.isCID(input)
2323
? input
24-
// @ts-ignore - TS seems to get confused by the type defs in CID repo.
2524
: new CID(input)
2625

2726
if (cid.version === 0 && options.base && options.base !== 'base58btc') {

packages/ipfs-core-utils/src/pins/normalise-input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = async function * normaliseInput (input) {
5050
// { cid: CID recursive, metadata }
5151
// @ts-ignore - it still could be iterable or async iterable
5252
if (input.cid != null || input.path != null) {
53-
// @ts-ignore
53+
// @ts-ignore - same as above
5454
return yield toPin(input)
5555
}
5656

packages/ipfs-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"array-shuffle": "^1.0.1",
5959
"bignumber.js": "^9.0.0",
6060
"cbor": "^5.1.0",
61-
"cids": "^1.0.0",
61+
"cids": "^1.0.2",
6262
"class-is": "^1.1.0",
6363
"dag-cbor-links": "^2.0.0",
6464
"datastore-core": "^2.0.0",

packages/ipfs-core/src/components/block/put.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ module.exports = ({ blockService, pin, gcLock, preload }) => {
7373
// Pick appropriate CID version
7474
cidVersion = mhtype === 'sha2-256' && format === 'dag-pb' ? 0 : 1
7575
} else {
76-
// @ts-ignore - options.version is a {number} but the CID constructor arg version is a {0|1}
77-
// TODO: https://github.com/multiformats/js-cid/pull/129
7876
cidVersion = options.version
7977
}
8078

packages/ipfs-core/src/components/block/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ exports.cleanCid = cid => {
1414

1515
// CID constructor knows how to do the cleaning :)
1616
try {
17-
// @ts-ignore - string|Uint8Array union seems to confuse CID typedefs.
1817
return new CID(cid)
1918
} catch (err) {
2019
throw errCode(err, 'ERR_INVALID_CID')

packages/ipfs-core/src/components/init.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ function createPeerId ({ privateKey, algorithm = 'RSA', bits, print }) {
309309
} else {
310310
// Generate peer identity keypair + transform to desired format + add to config.
311311
print('generating %s-bit (rsa only) %s keypair...', bits, algorithm)
312-
// @ts-ignore - expects "Ed25519" | "RSA" | "secp256k1" instoad of string
313312
return PeerId.create({ keyType: algorithm, bits })
314313
}
315314
}
@@ -551,7 +550,7 @@ function createApi ({
551550
* @typedef {import('./config').IPFSConfig} IPFSConfig
552551
* @typedef {import('.').IPFSRepo} IPFSRepo
553552
*
554-
* @typedef {'RSA' | 'ed25519' | 'secp256k1'} KeyType
553+
* @typedef {import('libp2p-crypto').KeyType} KeyType
555554
*
556555
* @typedef {string|PeerId} PrivateKey
557556
* Can be either a base64 string or a [PeerId](https://github.com/libp2p/js-peer-id)

packages/ipfs-core/src/components/pin/ls.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = ({ pinManager, dag }) => {
2828
/**
2929
* List all the objects pinned to local storage
3030
*
31-
* @param {LsOptions} [options]
31+
* @param {LsOptions & AbortOptions} [options]
3232
* @returns {AsyncIterable<LsEntry>}
3333
* @example
3434
* ```js
@@ -106,8 +106,6 @@ module.exports = ({ pinManager, dag }) => {
106106
}
107107

108108
if (type === PinTypes.indirect || type === PinTypes.all) {
109-
// @ts-ignore - LsSettings & AbortOptions have no properties in common
110-
// with type { preload?: boolean }
111109
for await (const cid of pinManager.indirectKeys(options)) {
112110
yield toPin(PinTypes.indirect, cid)
113111
}
@@ -124,11 +122,10 @@ module.exports = ({ pinManager, dag }) => {
124122
}
125123

126124
/**
127-
* @typedef {LsSettings & AbortOptions} LsOptions
128-
*
129-
* @typedef {Object} LsSettings
125+
* @typedef {Object} LsOptions
130126
* @property {string[]|CID[]} [paths] - CIDs or IPFS paths to search for in the pinset.
131127
* @property {PinQueryType} [type] - Filter by this type of pin ("recursive", "direct" or "indirect")
128+
* @property {boolean} [preload]
132129
*
133130
* @typedef {Object} LsEntry
134131
* @property {CID} cid - CID of the pinned node

packages/ipfs-core/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async function create (options = {}) {
7373
* @typedef {NonNullable<typeof startedApi>} StartedAPI
7474
* @type {If<Init, If<Start, StartedAPI, InitializedAPI>, API>}
7575
*/
76-
// @ts-ignore
76+
// @ts-ignore - Will be fixed by https://github.com/ipfs/js-ipfs/issues/3285
7777
const ipfs = startedApi || initializedApi || api
7878
return ipfs
7979
}

packages/ipfs-core/src/ipns/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ class IPNS {
3535

3636
// // Add to cache
3737
const id = peerId.toB58String()
38-
// @ts-ignore - parseFloat expects string
39-
const ttEol = parseFloat(lifetime)
38+
const ttEol = parseFloat(`${lifetime}`)
4039
const ttl = (ttEol < defaultRecordTtl) ? ttEol : defaultRecordTtl
4140

4241
this.cache.set(id, value, ttl)

packages/ipfs-core/src/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ const normalizeCidPath = (path) => {
8080
*/
8181
const resolvePath = async function (dag, ipfsPath, options = {}) {
8282
if (isIpfs.cid(ipfsPath)) {
83-
// @ts-ignore - CID|string seems to confuse typedef
8483
return new CID(ipfsPath)
8584
}
8685

packages/ipfs-core/src/utils/tlru.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
/** @type {typeof import('hashlru').default} */
4-
// @ts-ignore - hashlru has incorrect typedefs
4+
// @ts-ignore - https://github.com/dominictarr/hashlru/pull/24
55
const hashlru = require('hashlru')
66

77
/**

packages/ipfs-http-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"dependencies": {
5252
"any-signal": "^2.0.0",
5353
"bignumber.js": "^9.0.0",
54-
"cids": "^1.0.0",
54+
"cids": "^1.0.2",
5555
"debug": "^4.1.1",
5656
"form-data": "^3.0.0",
5757
"ipfs-core-utils": "^0.4.0",

packages/ipfs-http-client/src/bitswap/unwant.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ module.exports = configure(api => {
99
* @type {import('..').Implements<import('ipfs-core/src/components/bitswap/unwant')>}
1010
*/
1111
async function unwant (cid, options = {}) {
12+
if (Array.isArray(cid)) {
13+
throw Error('cid argument must be CID or a string')
14+
}
15+
1216
const res = await api.post('bitswap/unwant', {
1317
timeout: options.timeout,
1418
signal: options.signal,
1519
searchParams: toUrlSearchParams({
16-
// @ts-ignore - CID|string seems to confuse typedef
1720
arg: typeof cid === 'string' ? cid : new CID(cid).toString(),
1821
...options
1922
}),

packages/ipfs-http-client/src/bitswap/wantlist-for-peer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = configure(api => {
99
* @type {import('..').Implements<typeof import('ipfs-core/src/components/bitswap/wantlist-for-peer')>}
1010
*/
1111
async function wantlistForPeer (peerId, options = {}) {
12-
// @ts-ignore - CID|string seems to confuse typedef
12+
// @ts-ignore - CID doesn't take PeerId instance
1313
peerId = typeof peerId === 'string' ? peerId : new CID(peerId).toString()
1414

1515
const res = await (await api.post('bitswap/wantlist', {

packages/ipfs-http-client/src/block/get.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module.exports = configure(api => {
1010
* @type {import('..').Implements<import('ipfs-core/src/components/block/get')>}
1111
*/
1212
async function get (cid, options = {}) {
13-
// @ts-ignore - CID|string seems to confuse typedef
1413
cid = new CID(cid)
1514

1615
const res = await api.post('block/get', {

packages/ipfs-http-client/src/dag/put.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ module.exports = configure((api, opts) => {
5757

5858
if (!format) {
5959
if (opts && opts.ipld && opts.ipld.loadFormat) {
60-
// @ts-ignore - loadFormat expect string but it could be a number
6160
format = await opts.ipld.loadFormat(settings.format)
6261
}
6362

packages/ipfs-http-client/src/lib/buffer-to-form-data.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ const FormData = require('form-data')
44

55
// TODO form data append doesnt have header option
66

7-
// @ts-ignore
7+
/**
8+
* @param {Uint8Array} buf
9+
* @param {Object} [options]
10+
* @param {number|string} [options.mode]
11+
* @param {number|string} [options.mtime]
12+
* @param {number|string} [options.mtimeNsecs]
13+
*/
814
module.exports = (buf, { mode, mtime, mtimeNsecs } = {}) => {
915
const headers = {}
1016

packages/ipfs-http-client/src/lib/core.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const parseTimeout = (value) => {
114114
* @property {URL|string} [url] - Full API URL.
115115
* @property {object} [ipld]
116116
* @property {any[]} [ipld.formats] - An array of additional [IPLD formats](https://github.com/ipld/interface-ipld-format) to support
117-
* @property {(format: string) => Promise<any>} [ipld.loadFormat] - an async function that takes the name of an [IPLD format](https://github.com/ipld/interface-ipld-format) as a string and should return the implementation of that codec
117+
* @property {(format: string|number) => Promise<any>} [ipld.loadFormat] - an async function that takes the name of an [IPLD format](https://github.com/ipld/interface-ipld-format) as a string and should return the implementation of that codec
118118
*/
119119
class Client extends HTTP {
120120
/**
@@ -127,10 +127,13 @@ class Client extends HTTP {
127127
headers: opts.headers,
128128
base: normalizeInput(opts.url).toString(),
129129
handleError: errorHandler,
130+
/**
131+
* @param {URLSearchParams} search
132+
* @returns {URLSearchParams}
133+
*/
130134
transformSearchParams: (search) => {
131135
const out = new URLSearchParams()
132136

133-
// @ts-ignore https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
134137
for (const [key, value] of search) {
135138
if (
136139
value !== 'undefined' &&
@@ -141,7 +144,7 @@ class Client extends HTTP {
141144
}
142145

143146
// server timeouts are strings
144-
if (key === 'timeout' && !isNaN(value)) {
147+
if (key === 'timeout' && !isNaN(parseInt(value))) {
145148
out.append(kebabCase(key), value)
146149
}
147150
}

packages/ipfs-http-gateway/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@hapi/ammo": "^5.0.1",
3333
"@hapi/boom": "^9.1.0",
3434
"@hapi/hapi": "^20.0.0",
35-
"cids": "^1.0.0",
35+
"cids": "^1.0.2",
3636
"debug": "^4.1.1",
3737
"hapi-pino": "^8.3.0",
3838
"ipfs-core-utils": "^0.4.0",

packages/ipfs-http-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@hapi/boom": "^9.1.0",
3333
"@hapi/content": "^5.0.2",
3434
"@hapi/hapi": "^20.0.0",
35-
"cids": "^1.0.0",
35+
"cids": "^1.0.2",
3636
"debug": "^4.1.1",
3737
"dlv": "^1.1.3",
3838
"err-code": "^2.0.3",

packages/ipfs-http-server/src/api/resources/shutdown.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
*/
99
module.exports = {
1010
handler: (_request, h) => {
11-
// @ts-ignore - TS expects second argument
12-
setImmediate(() => process.emit('SIGTERM'))
11+
setImmediate(() => process.emit('SIGTERM', 'SIGTERM'))
1312
return h.response()
1413
}
1514
}

packages/ipfs-http-server/src/utils/joi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const reqiureIfRequired = (value, helpers) => {
4646
module.exports = Joi
4747
.extend(
4848
// @ts-ignore - according to typedfs coerce should always return
49-
// { errors?: ErrorReport[], value?: any }
49+
// { errors?: ErrorReport[], value?: any } but below undefined is returned.
5050
(joi) => {
5151
return {
5252
type: 'cid',

packages/ipfs-message-port-client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"dep-check": "aegir dep-check"
4242
},
4343
"dependencies": {
44-
"browser-readablestream-to-it": "0.0.2",
45-
"cids": "^1.0.0"
44+
"browser-readablestream-to-it": "^1.0.1",
45+
"cids": "^1.0.2"
4646
},
4747
"devDependencies": {
4848
"aegir": "^28.0.0",

packages/ipfs-message-port-client/src/core.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ const {
99
encodeIterable,
1010
encodeCallback
1111
} = require('ipfs-message-port-protocol/src/core')
12-
/** @type {<T>(stream:ReadableStream<T>) => AsyncIterable<T>} */
13-
// @ts-ignore - browser-stream-to-it has not types
1412
const iterateReadableStream = require('browser-readablestream-to-it')
1513

1614
/**

packages/ipfs-message-port-protocol/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"dep-check": "aegir dep-check"
4242
},
4343
"dependencies": {
44-
"cids": "^1.0.0",
44+
"cids": "^1.0.2",
4545
"ipld-block": "^0.10.1"
4646
},
4747
"devDependencies": {

packages/ipfs-message-port-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"dep-check": "aegir dep-check"
4444
},
4545
"dependencies": {
46-
"cids": "^1.0.0",
46+
"cids": "^1.0.2",
4747
"it-all": "^1.0.4"
4848
},
4949
"devDependencies": {

0 commit comments

Comments
 (0)