Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 066988f

Browse files
authored
fix: support all the Buffer shims and load fixtures correctly
* test: add failing test with Buffer package * chore * fix: fixtures are loaded using the same call in node and browser * chore: update deps * chore: update deps
1 parent debb1e0 commit 066988f

File tree

6 files changed

+205
-332
lines changed

6 files changed

+205
-332
lines changed

.aegir.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const server = createServer()
77
module.exports = {
88
karma: {
99
files: [{
10-
pattern: 'node_modules/interface-ipfs-core/test/fixtures/**/*',
10+
pattern: 'node_modules/interface-ipfs-core/js/test/fixtures/**/*',
1111
watched: false,
1212
served: true,
1313
included: false

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"glob": "^7.1.2",
3636
"ipfs-block": "~0.6.1",
3737
"ipfs-unixfs": "~0.1.14",
38-
"ipld-dag-pb": "~0.11.4",
38+
"ipld-dag-pb": "~0.13.0",
3939
"is-ipfs": "^0.3.2",
4040
"is-stream": "^1.1.0",
4141
"lru-cache": "^4.1.1",
@@ -65,13 +65,13 @@
6565
"url": "https://github.com/ipfs/js-ipfs-api"
6666
},
6767
"devDependencies": {
68-
"aegir": "^12.4.0",
68+
"aegir": "^13.0.0",
6969
"chai": "^4.1.2",
7070
"dirty-chai": "^2.0.1",
7171
"eslint-plugin-react": "^7.6.1",
7272
"go-ipfs-dep": "^0.4.13",
7373
"gulp": "^3.9.1",
74-
"interface-ipfs-core": "~0.48.0",
74+
"interface-ipfs-core": "~0.49.1",
7575
"hapi": "^17.2.0",
7676
"ipfsd-ctl": "~0.28.0",
7777
"pre-commit": "^1.2.2",

src/files/add.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const promisify = require('promisify-es6')
44
const ConcatStream = require('concat-stream')
55
const once = require('once')
66
const isStream = require('is-stream')
7+
const OtherBuffer = require('buffer').Buffer
78
const SendFilesStream = require('../utils/send-files-stream')
89

910
module.exports = (send) => {
@@ -23,7 +24,8 @@ module.exports = (send) => {
2324

2425
const ok = Buffer.isBuffer(_files) ||
2526
isStream.readable(_files) ||
26-
Array.isArray(_files)
27+
Array.isArray(_files) ||
28+
OtherBuffer.isBuffer(_files)
2729

2830
if (!ok) {
2931
return callback(new Error('"files" must be a buffer, readable stream, or array of objects'))

0 commit comments

Comments
 (0)