Skip to content

Commit 021b1f2

Browse files
committed
chore: remove/comment some ts-ignores
1 parent 8e00ac7 commit 021b1f2

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

packages/ipfs-unixfs-exporter/src/resolvers/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function resolve (cid, name, path, toResolve, depth, blockService, options) {
2828
const resolver = resolvers[cid.code]
2929

3030
if (!resolver) {
31-
// @ts-ignore - TODO vmx 2021-03-05: Add proper typing
31+
// @ts-ignore - A `CodecCode` is expected, but a number is just fine
3232
throw errCode(new Error(`No resolver for codec ${multicodec.getName(cid.code)}`), 'ERR_NO_RESOLVER')
3333
}
3434

packages/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/file.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ async function * emitBytes (blockService, node, start, end, streamPosition = 0,
8181
child = await dagCbor.decode(block.bytes)
8282
break
8383
default:
84-
// TODO vmx 2021-03-05: fix this type issue properly
85-
// @ts-ignore
84+
// @ts-ignore - A `CodecCode` is expected, but a number is just fine
8685
throw Error(`Unsupported codec: ${mc.getName(childLink.Hash.code)}`)
8786
}
8887

packages/ipfs-unixfs-exporter/test/exporter-sharded.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe('exporter sharded', function () {
128128
const data = uint8ArrayConcat(await all(dirFile.content()))
129129

130130
// validate the CID
131-
// @ts-ignore - TODO vmx 2021-03-25: fix that one
131+
// @ts-ignore - files[dirFile.name].cid is defined
132132
expect(files[dirFile.name].cid.toString()).that.deep.equals(dirFile.cid.toString())
133133

134134
// validate the exported file content

packages/ipfs-unixfs-importer/test/chunker-custom.spec.js

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
const { importer } = require('../src')
55
const { expect } = require('aegir/utils/chai')
66
const rawCodec = require('multiformats/codecs/raw')
7-
// @ts-ignore
87
const { sha256 } = require('multiformats/hashes/sha2')
98
const Block = require('multiformats/block')
109
const blockApi = require('./helpers/block')

0 commit comments

Comments
 (0)