Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
chore: upgrade dependencies (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos authored Jan 18, 2019
1 parent 076fde3 commit ba6a6dd
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@
},
"homepage": "https://github.com/ipfs/js-ipfs-http-response#readme",
"dependencies": {
"async": "^2.6.0",
"cids": "~0.5.5",
"debug": "^3.1.0",
"async": "^2.6.1",
"cids": "~0.5.7",
"debug": "^4.1.1",
"file-type": "^8.0.0",
"filesize": "^3.6.1",
"get-stream": "^3.0.0",
"ipfs-unixfs": "~0.1.14",
"mime-types": "^2.1.18",
"multihashes": "~0.4.13",
"ipfs-unixfs": "~0.1.16",
"mime-types": "^2.1.21",
"multihashes": "~0.4.14",
"promisify-es6": "^1.0.3",
"stream-to-blob": "^1.0.1"
},
"devDependencies": {
"aegir": "^13.1.0",
"chai": "^4.1.2",
"aegir": "^18.0.3",
"chai": "^4.2.0",
"dirty-chai": "^2.0.1",
"ipfs": "~0.32.2",
"ipfsd-ctl": "~0.39.1"
"ipfs": "0.34.0",
"ipfsd-ctl": "~0.40.3"
},
"contributors": [
"Alex Potsides <alex@achingbrain.net>",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const response = (ipfsNode, ipfsPath) => {

resolver.cid(ipfsNode, ipfsPath)
.then((resolvedData) => {
const readableStream = ipfsNode.files.catReadableStream(resolvedData.cid)
const readableStream = ipfsNode.catReadableStream(resolvedData.cid)
const responseStream = new stream.PassThrough({ highWaterMark: 1 })
readableStream.pipe(responseStream)

Expand Down
22 changes: 11 additions & 11 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ describe('resolve file (CIDv0)', function () {
ipfsd = _ipfsd
ipfs = ipfsd.api

ipfs.files.add(file.data, {cidVersion: 0}, (err, filesAdded) => {
ipfs.add(file.data, { cidVersion: 0 }, (err, filesAdded) => {
expect(err).to.not.exist()
expect(filesAdded).to.have.length(1)

const retrievedFile = filesAdded[0]
expect(new CID(retrievedFile.hash)).to.deep.equal(new CID(file.cid))
expect(retrievedFile.size, 'ipfs.files.add result size should not be smaller than input buffer').greaterThan(file.data.length)
expect(retrievedFile.size, 'ipfs.add result size should not be smaller than input buffer').greaterThan(file.data.length)

done()
})
Expand Down Expand Up @@ -79,12 +79,12 @@ describe('resolve file (CIDv1)', function () {
ipfsd = _ipfsd
ipfs = ipfsd.api

ipfs.files.add(file.data, {cidVersion: 1}, (err, filesAdded) => {
ipfs.add(file.data, { cidVersion: 1 }, (err, filesAdded) => {
expect(err).to.not.exist()
expect(filesAdded).to.have.length(1)
const retrievedFile = filesAdded[0]
expect(new CID(retrievedFile.hash)).to.deep.equal(new CID(file.cid))
// expect(retrievedFile.size, 'ipfs.files.add result size should not be smaller than input buffer').greaterThan(file.data.length)
// expect(retrievedFile.size, 'ipfs.add result size should not be smaller than input buffer').greaterThan(file.data.length)

done()
})
Expand Down Expand Up @@ -135,15 +135,15 @@ describe('resolve directory (CIDv0)', function () {
content('holmes.txt')
]

ipfs.files.add(dirs, {cidVersion: 0}, (err, res) => {
ipfs.add(dirs, { cidVersion: 0 }, (err, res) => {
expect(err).to.not.exist()
const root = res[res.length - 1]

expect(root.path).to.equal('test-folder')
expect(new CID(root.hash)).to.deep.equal(new CID(directory.cid))

expect(res[0].size, 'ipfs.files.add 1st result size should not be smaller than 1st input buffer').greaterThan(dirs[0].content.length)
expect(res[1].size, 'ipfs.files.add 2nd result size should not be smaller than 2nd input buffer').greaterThan(dirs[1].content.length)
expect(res[0].size, 'ipfs.add 1st result size should not be smaller than 1st input buffer').greaterThan(dirs[0].content.length)
expect(res[1].size, 'ipfs.add 2nd result size should not be smaller than 2nd input buffer').greaterThan(dirs[1].content.length)

done()
})
Expand Down Expand Up @@ -207,7 +207,7 @@ describe('resolve directory (CIDv1)', function () {
content('holmes.txt')
]

ipfs.files.add(dirs, {cidVersion: 1}, (err, res) => {
ipfs.add(dirs, { cidVersion: 1 }, (err, res) => {
expect(err).to.not.exist()
const root = res[res.length - 1]
expect(root.path).to.equal('test-folder')
Expand Down Expand Up @@ -278,7 +278,7 @@ describe('resolve web page (CIDv0)', function () {
content('index.html')
]

ipfs.files.add(dirs, {cidVersion: 0}, (err, res) => {
ipfs.add(dirs, { cidVersion: 0 }, (err, res) => {
expect(err).to.not.exist()
const root = res[res.length - 1]

Expand Down Expand Up @@ -330,7 +330,7 @@ describe('resolve web page (CIDv1)', function () {
content('index.html')
]

ipfs.files.add(dirs, {cidVersion: 1}, (err, res) => {
ipfs.add(dirs, { cidVersion: 1 }, (err, res) => {
expect(err).to.not.exist()
const root = res[res.length - 1]
expect(root.path).to.equal('test-site')
Expand Down Expand Up @@ -386,7 +386,7 @@ describe('mime-types', () => {
content('index.html')
]

ipfs.files.add(dirs, {cidVersion: 0}, (err, res) => {
ipfs.add(dirs, { cidVersion: 0 }, (err, res) => {
expect(err).to.not.exist()
const root = res[res.length - 1]

Expand Down
12 changes: 6 additions & 6 deletions test/resolver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('resolve file (CIDv0)', function () {
ipfsd = _ipfsd
ipfs = ipfsd.api

ipfs.files.add(file.data, {cidVersion: 0}, (err, filesAdded) => {
ipfs.add(file.data, { cidVersion: 0 }, (err, filesAdded) => {
expect(err).to.not.exist()
expect(filesAdded).to.have.length(1)

Expand Down Expand Up @@ -81,7 +81,7 @@ describe('resolve file (CIDv1)', function () {
ipfsd = _ipfsd
ipfs = ipfsd.api

ipfs.files.add(file.data, {cidVersion: 1}, (err, filesAdded) => {
ipfs.add(file.data, { cidVersion: 1 }, (err, filesAdded) => {
expect(err).to.not.exist()
expect(filesAdded).to.have.length(1)
// console.log('ipfs.files.add result', filesAdded)
Expand Down Expand Up @@ -143,7 +143,7 @@ describe('resolve directory (CIDv0)', function () {
content('holmes.txt')
]

ipfs.files.add(dirs, {cidVersion: 0}, (err, res) => {
ipfs.add(dirs, { cidVersion: 0 }, (err, res) => {
expect(err).to.not.exist()
const root = res[res.length - 1]

Expand Down Expand Up @@ -201,7 +201,7 @@ describe('resolve directory (CIDv1)', function () {
content('holmes.txt')
]

ipfs.files.add(dirs, {cidVersion: 1}, (err, res) => {
ipfs.add(dirs, { cidVersion: 1 }, (err, res) => {
expect(err).to.not.exist()
const root = res[res.length - 1]
// console.log('ipfs.files.add result', res)
Expand Down Expand Up @@ -264,7 +264,7 @@ describe('resolve web page (CIDv0)', function () {
content('index.html')
]

ipfs.files.add(dirs, {cidVersion: 0}, (err, res) => {
ipfs.add(dirs, { cidVersion: 0 }, (err, res) => {
expect(err).to.not.exist()
const root = res[res.length - 1]

Expand Down Expand Up @@ -326,7 +326,7 @@ describe('resolve web page (CIDv1)', function () {
content('index.html')
]

ipfs.files.add(dirs, {cidVersion: 1}, (err, res) => {
ipfs.add(dirs, { cidVersion: 1 }, (err, res) => {
expect(err).to.not.exist()
// console.log(res)
const root = res[res.length - 1]
Expand Down

0 comments on commit ba6a6dd

Please sign in to comment.