From eb14683b06fdde1554a078a84de08bee8a6d863b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jimmy=20W=C3=A4rting?= Date: Fri, 19 Apr 2019 17:26:07 +0200 Subject: [PATCH] added arrayBuffer and text methods to blob --- Blob.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Blob.js b/Blob.js index 41c23f7..5789e80 100644 --- a/Blob.js +++ b/Blob.js @@ -366,7 +366,14 @@ } else { this.type = this.type.toLowerCase() } + } + Blob.prototype.arrayBuffer = function () { + return Promise.resolve(this._buffer) + } + + Blob.prototype.text = function () { + return Promise.resolve(textDecode(this._buffer)) } Blob.prototype.slice = function (start, end, type) {