Sorry for such a big commit/change... would rather want to do smaller PR and many PR, but it often result in things taking longer for things to be accepted and merged...
When stream, arrayBuffer and text was announced i started to look back into node-fetch to try and implement dose functionalities... And they are there now.
But node-fetch is looking into extracting out there own Blob implementation and use a third-party blob implementation instead, figured instead of creating yet another module we could use something that already exist. so i looked back into your Blob.js implementation.
If node-fetch is ever going to use your version of blob.js then there are a few things that needs to happen before we even consider it. And that is what this PR is solving.
stream, text and arrayBuffer need to exist.
Node is going to want to have typed arrays (this pr now use them when possible)
text must provide the same result as response.text() and FileReader.readAsText
(your current version didn't) test the old and the new (this PR) in jsfiddle
setting Symbol.toStringTag didn't work correctly when blob was undefined
other nice things that i found while search browsers native test harness
the new methods require promises and readableStream but I thing that is beyond the scope of blob.js
They should include stream and promise polyfills themself if they need to
Sorry for such a big commit/change... would rather want to do smaller PR and many PR, but it often result in things taking longer for things to be accepted and merged...
When stream, arrayBuffer and text was announced i started to look back into node-fetch to try and implement dose functionalities... And they are there now.
But node-fetch is looking into extracting out there own Blob implementation and use a third-party blob implementation instead, figured instead of creating yet another module we could use something that already exist. so i looked back into your Blob.js implementation.
If node-fetch is ever going to use your version of blob.js then there are a few things that needs to happen before we even consider it. And that is what this PR is solving.
response.text()
andFileReader.readAsText
/
to:
in FileNames)closes #65 closes #66