New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@whatwg-node/fetch

Package Overview
Dependencies
Maintainers
1
Versions
521
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.9.18 to 0.9.19-alpha-20240726002236-105dd434a11d1e455ea8f23481530c2ec4ca0aae

dist/esm-ponyfill.js

13

CHANGELOG.md
# @whatwg-node/fetch
## 0.9.19-alpha-20240726002236-105dd434a11d1e455ea8f23481530c2ec4ca0aae
### Patch Changes
- [#1495](https://github.com/ardatan/whatwg-node/pull/1495)
[`105dd43`](https://github.com/ardatan/whatwg-node/commit/105dd434a11d1e455ea8f23481530c2ec4ca0aae)
Thanks [@ardatan](https://github.com/ardatan)! - Implement \`CompressionStream\`,
\`WritableStream\` and \`TransformStream\`
- Updated dependencies
[[`105dd43`](https://github.com/ardatan/whatwg-node/commit/105dd434a11d1e455ea8f23481530c2ec4ca0aae)]:
- @whatwg-node/node-fetch@0.5.16-alpha-20240726002236-105dd434a11d1e455ea8f23481530c2ec4ca0aae
## 0.9.18

@@ -4,0 +17,0 @@

36

dist/create-node-ponyfill.js

@@ -6,2 +6,4 @@ const shouldSkipPonyfill = require('./shouldSkipPonyfill');

ponyfills.URLPattern = globalThis.URLPattern;
// We call this previously to patch `Bun`

@@ -14,3 +16,23 @@ if (!ponyfills.URLPattern) {

if (opts.skipPonyfill || shouldSkipPonyfill()) {
return globalThis;
return {
fetch: globalThis.fetch,
Headers: globalThis.Headers,
Request: globalThis.Request,
Response: globalThis.Response,
FormData: globalThis.FormData,
ReadableStream: globalThis.ReadableStream,
WritableStream: globalThis.WritableStream,
TransformStream: globalThis.TransformStream,
CompressionStream: globalThis.CompressionStream,
DecompressionStream: globalThis.DecompressionStream,
Blob: globalThis.Blob,
File: globalThis.File,
crypto: globalThis.crypto,
btoa: globalThis.btoa,
TextEncoder: globalThis.TextEncoder,
TextDecoder: globalThis.TextDecoder,
URLPattern: ponyfills.URLPattern,
URL: globalThis.URL,
URLSearchParams: globalThis.URLSearchParams
};
}

@@ -30,11 +52,7 @@

ponyfills.WritableStream = globalThis.WritableStream;
ponyfills.TransformStream = globalThis.TransformStream;
ponyfills.WritableStream = newNodeFetch.WritableStream;
ponyfills.TransformStream = newNodeFetch.TransformStream;
ponyfills.CompressionStream = newNodeFetch.CompressionStream;
ponyfills.DecompressionStream = newNodeFetch.DecompressionStream;
if (!ponyfills.WritableStream) {
const streamsWeb = require("stream/web");
ponyfills.WritableStream = streamsWeb.WritableStream;
ponyfills.TransformStream = streamsWeb.TransformStream;
}
ponyfills.Blob = newNodeFetch.Blob;

@@ -41,0 +59,0 @@ ponyfills.File = newNodeFetch.File;

@@ -9,2 +9,4 @@ module.exports.fetch = globalThis.fetch; // To enable: import {fetch} from 'cross-fetch'

module.exports.TransformStream = globalThis.TransformStream;
module.exports.CompressionStream = globalThis.CompressionStream;
module.exports.DecompressionStream = globalThis.DecompressionStream;
module.exports.Blob = globalThis.Blob;

@@ -11,0 +13,0 @@ module.exports.File = globalThis.File;

@@ -18,2 +18,4 @@ /// <reference lib="dom" />

export const TransformStream: typeof globalThis.TransformStream;
export const CompressionStream: typeof globalThis.CompressionStream;
export const DecompressionStream: typeof globalThis.DecompressionStream;
export const Blob: typeof globalThis.Blob;

@@ -57,2 +59,4 @@ export const File: typeof globalThis.File;

TransformStream: typeof TransformStream;
CompressionStream: typeof CompressionStream;
DecompressionStream: typeof DecompressionStream;
Blob: typeof Blob;

@@ -59,0 +63,0 @@ File: typeof File;

@@ -21,2 +21,4 @@

module.exports.TransformStream = ponyfills.TransformStream;
module.exports.CompressionStream = ponyfills.CompressionStream;
module.exports.DecompressionStream = ponyfills.DecompressionStream;
module.exports.Blob = ponyfills.Blob;

@@ -23,0 +25,0 @@ module.exports.File = ponyfills.File;

{
"name": "@whatwg-node/fetch",
"version": "0.9.18",
"version": "0.9.19-alpha-20240726002236-105dd434a11d1e455ea8f23481530c2ec4ca0aae",
"description": "Cross Platform Smart Fetch Ponyfill",

@@ -19,3 +19,3 @@ "repository": {

"dependencies": {
"@whatwg-node/node-fetch": "^0.5.7",
"@whatwg-node/node-fetch": "0.5.16-alpha-20240726002236-105dd434a11d1e455ea8f23481530c2ec4ca0aae",
"urlpattern-polyfill": "^10.0.0"

@@ -29,5 +29,5 @@ },

"denoify": {
"index": "dist/deno-ponyfill.ts"
"index": "dist/esm-ponyfill.js"
},
"react-native": "dist/global-ponyfill.js"
}
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