Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@whatwg-node/fetch

Package Overview
Dependencies
Maintainers
1
Versions
475
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@whatwg-node/fetch - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2-alpha-20221111153639-062b25b

6

CHANGELOG.md
# @whatwg-node/fetch
## 0.5.2-alpha-20221111153639-062b25b
### Patch Changes
- [#179](https://github.com/ardatan/whatwg-node/pull/179) [`1e7b5ec`](https://github.com/ardatan/whatwg-node/commit/1e7b5ecfcf9a35b0a46357389f1410e4b3150f2a) Thanks [@ardatan](https://github.com/ardatan)! - Fix destroy method for ReadableStream to Readable conversion
## 0.5.1

@@ -4,0 +10,0 @@

27

dist/readableStreamToReadable.js
const streams = require('stream');
module.exports = function readableStreamToReadable(readableStream) {
return streams.Readable.from({
[Symbol.asyncIterator]() {
const reader = readableStream.getReader();
return {
next() {
return reader.read();
},
async return() {
const reader = readableStream.getReader();
return new streams.Readable({
read() {
reader.read().then(({ done, value }) => {
if (done) {
this.push(null);
} else {
this.push(value);
}
})
},
async destroy() {
try {
reader.cancel();
reader.releaseLock();
await readableStream.cancel();
return { done: true };
}
} catch (error) {
console.log(error);
}
}
});
})
}
{
"name": "@whatwg-node/fetch",
"version": "0.5.1",
"version": "0.5.2-alpha-20221111153639-062b25b",
"description": "Cross Platform Smart Fetch Ponyfill",

@@ -5,0 +5,0 @@ "author": "Arda TANRIKULU <ardatanrikulu@gmail.com>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc