File shim now translates correctly

This commit is contained in:
d98762625 2019-03-14 16:33:09 +00:00
parent d080c5dd14
commit 2019ae43d7
7 changed files with 14 additions and 28 deletions

View file

@ -336,13 +336,11 @@ class Dish {
// Node environment => translate is sync
if (Utils.isNode()) {
console.log('Running in node');
this._toByteArray();
this._fromByteArray(toType, notUTF8);
// Browser environment => translate is async
} else {
console.log('Running in browser');
return new Promise((resolve, reject) => {
this._toByteArray()
.then(() => this.type = Dish.BYTE_ARRAY)