Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
A few `@ts-ignore`s are needed until js-dag-cbor is updated to work
properly with CommonJS and TypeScript types.
  • Loading branch information
vmx committed Apr 1, 2021
1 parent 031bf2d commit e972a48
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/ipfs-unixfs-exporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@
"util": "^0.12.3"
},
"dependencies": {
"@ipld/dag-cbor": "^3.0.0",
"@ipld/dag-cbor": "^4.0.0",
"@ipld/dag-pb": "^0.0.1",
"err-code": "^3.0.1",
"hamt-sharding": "^2.0.0",
"ipfs-unixfs": "^4.0.1",
"it-last": "^1.0.5",
"multicodec": "^3.0.1",
"multiformats": "^4.6.1",
"multiformats": "^6.0.0",
"multihashing-async": "^2.1.0"
},
"types": "dist/src/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions packages/ipfs-unixfs-exporter/src/resolvers/dag-cbor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const dagCbor = require('@ipld/dag-cbor')
*/
const resolve = async (cid, name, path, toResolve, resolve, depth, blockService, options) => {
const block = await blockService.get(cid)
// @ts-ignore - TODO vmx 2021-04-01: will work once js-dag-cbor has proper types
const object = dagCbor.decode(block.bytes)
let subObject = object
let subPath = path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ async function * emitBytes (blockService, node, start, end, streamPosition = 0,
child = block.bytes
break;
case mc.DAG_CBOR:
// @ts-ignore - TODO vmx 2021-04-01: will work once js-dag-cbor has proper types
child = await dagCbor.decode(block.bytes)
break;
default:
Expand Down
3 changes: 3 additions & 0 deletions packages/ipfs-unixfs-exporter/test/exporter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,7 @@ describe('exporter', () => {
it('errors when exporting a non-existent key from a cbor node', async () => {
const cborBlock = await Block.encode({
value: { foo: 'bar' },
// @ts-ignore - TODO vmx 2021-04-01: will work once js-dag-cbor has proper types
codec: dagCbor,
hasher: sha256
})
Expand All @@ -992,6 +993,7 @@ describe('exporter', () => {

const cborBlock = await Block.encode({
value: node,
// @ts-ignore - TODO vmx 2021-04-01: will work once js-dag-cbor has proper types
codec: dagCbor,
hasher: sha256
})
Expand Down Expand Up @@ -1048,6 +1050,7 @@ describe('exporter', () => {
it('errors we export a unixfs node that has a non-unixfs/dag-pb child', async () => {
const cborBlock = await Block.encode({
value: { foo: 'bar' },
// @ts-ignore - TODO vmx 2021-04-01: will work once js-dag-cbor has proper types
codec: dagCbor,
hasher: sha256
})
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-unixfs-importer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"it-parallel-batch": "^1.0.9",
"merge-options": "^3.0.4",
"multicodec": "^3.0.1",
"multiformats": "^4.6.1",
"multiformats": "^6.0.0",
"multihashing-async": "^2.1.0",
"rabin-wasm": "^0.1.4",
"uint8arrays": "^2.1.2"
Expand Down

0 comments on commit e972a48

Please sign in to comment.