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

fix: typeof bug when passing timeout to dag.get #3035

Merged
merged 1 commit into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/interface-ipfs-core/src/dag/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ module.exports = (common, options) => {
expect(result.value.equals(cidPb)).to.be.true()
})

it('should get with options and no path', async function () {
const result = await ipfs.dag.get(cidCbor, { localResolve: true })
expect(result.value).to.deep.equal(nodeCbor)
})

it('should get a node added as CIDv0 with a CIDv1', async () => {
const input = Buffer.from(`TEST${Math.random()}`)

Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/dag/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = configure((api, options) => {
const dagResolve = require('./resolve')(options)

return async (cid, path, options = {}) => {
if (typeof path === 'object') {
if (path && typeof path === 'object') {
options = path
path = null
}
Expand Down