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

Commit ef4bf22

Browse files
committed
fix large file tests
1 parent c292b5a commit ef4bf22

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/components/files.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ module.exports = function files (self) {
210210
const p = _catPullStream(ipfsPath)
211211
pull(
212212
p,
213-
pull.concat((err, data) => callback(err, Buffer.from(data)))
213+
pull.reduce((a, b) => Buffer.concat([a, b]), Buffer.alloc(0), callback)
214214
)
215215
}),
216216

@@ -229,10 +229,10 @@ module.exports = function files (self) {
229229
if (file.content) {
230230
pull(
231231
file.content,
232-
pull.concat((err, data) => {
232+
pull.reduce((a, b) => Buffer.concat([a, b]), Buffer.alloc(0), (err, data) => {
233233
if (err) { throw err }
234234

235-
file.content = Buffer.from(data)
235+
file.content = data
236236
cb(null, file)
237237
})
238238
)

0 commit comments

Comments
 (0)