Skip to content

Commit

Permalink
Fixed missing TypeArray slice on constrained environments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Feb 4, 2019
1 parent 429af2c commit 14484e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src.ts/utils/basex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class BaseX {
bytes.push(0)
}

return new Uint8Array(bytes.reverse())
return arrayify(new Uint8Array(bytes.reverse()))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src.ts/utils/bytes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function addSlice(array: Uint8Array): Uint8Array {

array.slice = function() {
var args = Array.prototype.slice.call(arguments);
return new Uint8Array(Array.prototype.slice.apply(array, args));
return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));
}

return array;
Expand Down

0 comments on commit 14484e5

Please sign in to comment.