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

Commit d32dad9

Browse files
dryajovdaviddias
authored andcommitted
fix: accept objects in file.add (#1257)
hotfix: this was a regression on last release
1 parent 5b40b41 commit d32dad9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"hapi-set-header": "^1.0.2",
108108
"hoek": "^5.0.3",
109109
"human-to-milliseconds": "^1.0.0",
110-
"ipfs-api": "^18.1.1",
110+
"ipfs-api": "^18.1.2",
111111
"ipfs-bitswap": "~0.19.0",
112112
"ipfs-block": "~0.6.1",
113113
"ipfs-block-service": "~0.13.0",

src/core/components/files.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,11 @@ module.exports = function files (self) {
193193
const ok = Buffer.isBuffer(data) ||
194194
isStream.readable(data) ||
195195
Array.isArray(data) ||
196-
OtherBuffer.isBuffer(data)
196+
OtherBuffer.isBuffer(data) ||
197+
typeof data === 'object'
197198

198199
if (!ok) {
199-
return callback(new Error('Invalid arguments, data must be an object, Buffer or readable stream'))
200+
return callback(new Error('first arg must be a buffer, readable stream, an object or array of objects'))
200201
}
201202

202203
pull(

0 commit comments

Comments
 (0)