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

Commit 7684d88

Browse files
committed
Fix Blob to Text conversion error
1 parent 80cc711 commit 7684d88

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ class FetchBlobResponse {
257257
Blob.build(this.data, { type : cType + ';BASE64' }).then(resolve)
258258
break
259259
case 'path':
260+
console.log('##', 'reading path')
260261
polyfill.Blob.build(wrap(this.data), { type : cType }).then(resolve)
261262
break
262263
default:
@@ -276,7 +277,7 @@ class FetchBlobResponse {
276277
return base64.decode(this.data)
277278
break
278279
case 'path':
279-
return fs.readFile(this.data, 'utf8')
280+
return fs.readFile(this.data, 'base64').then((b64) => Promise.resolve(base64.decode(b64)))
280281
break
281282
default:
282283
return this.data

0 commit comments

Comments
 (0)