DamonOehlman / filestream

W3C File Reader API streaming interfaces
30 stars 11 forks source link

uninstall typedarray-to-buffer? #23

Open jimmywarting opened 3 years ago

jimmywarting commented 3 years ago

It feels like you could just do

this.push(Buffer.from(reader.result))

You are using the FileReader and it will always return a ArrayBuffer... You are not getting any unknown typed arrays from any other sources.

https://github.com/DamonOehlman/filestream/blob/f5c9d3c54da5e2d0793827e7d530f961d5362cb9/read.js#L4 https://github.com/DamonOehlman/filestream/blob/f5c9d3c54da5e2d0793827e7d530f961d5362cb9/read.js#L22 https://github.com/DamonOehlman/filestream/blob/f5c9d3c54da5e2d0793827e7d530f961d5362cb9/read.js#L67