@whatwg-node/node-fetch
Advanced tools
Comparing version 0.7.4 to 0.7.5-alpha-20241210190244-f8654a00cd5b6a4eda10e114502523848eaec29f
@@ -128,2 +128,3 @@ "use strict"; | ||
if (this._buffer) { | ||
// @ts-expect-error - `Buffer` and `ArrayBuffer` are compatible | ||
return (0, utils_js_1.fakePromise)(this._buffer); | ||
@@ -139,2 +140,3 @@ } | ||
} | ||
// @ts-expect-error - `Buffer` and `ArrayBuffer` are compatible | ||
return this.buffer(); | ||
@@ -141,0 +143,0 @@ } |
@@ -272,2 +272,3 @@ "use strict"; | ||
arrayBuffer() { | ||
// @ts-expect-error - `Buffer` and `ArrayBuffer` are compatible | ||
return this.buffer(); | ||
@@ -274,0 +275,0 @@ } |
@@ -5,3 +5,3 @@ "use strict"; | ||
exports.isHeadersLike = isHeadersLike; | ||
const util_1 = require("util"); | ||
const node_util_1 = require("node:util"); | ||
const IteratorObject_js_1 = require("./IteratorObject.js"); | ||
@@ -254,5 +254,5 @@ function isHeadersLike(headers) { | ||
}); | ||
return `Headers ${(0, util_1.inspect)(record)}`; | ||
return `Headers ${(0, node_util_1.inspect)(record)}`; | ||
} | ||
} | ||
exports.PonyfillHeaders = PonyfillHeaders; |
@@ -20,2 +20,5 @@ "use strict"; | ||
this.parse(url, false); | ||
if (url.startsWith('http://[') || url.startsWith('https://[')) { | ||
this.hostname = `[${this.hostname}]`; | ||
} | ||
if (base) { | ||
@@ -52,2 +55,5 @@ const baseParsed = typeof base === 'string' ? new PonyfillURL(base) : base; | ||
toString() { | ||
if (this._searchParams) { | ||
this.search = this._searchParams.toString(); | ||
} | ||
return this.format(); | ||
@@ -54,0 +60,0 @@ } |
@@ -117,2 +117,3 @@ /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ | ||
if (this._buffer) { | ||
// @ts-expect-error - `Buffer` and `ArrayBuffer` are compatible | ||
return fakePromise(this._buffer); | ||
@@ -128,2 +129,3 @@ } | ||
} | ||
// @ts-expect-error - `Buffer` and `ArrayBuffer` are compatible | ||
return this.buffer(); | ||
@@ -130,0 +132,0 @@ } |
@@ -268,2 +268,3 @@ import { Readable } from 'stream'; | ||
arrayBuffer() { | ||
// @ts-expect-error - `Buffer` and `ArrayBuffer` are compatible | ||
return this.buffer(); | ||
@@ -270,0 +271,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { inspect } from 'util'; | ||
import { inspect } from 'node:util'; | ||
import { PonyfillIteratorObject } from './IteratorObject.js'; | ||
@@ -3,0 +3,0 @@ export function isHeadersLike(headers) { |
@@ -16,2 +16,5 @@ import { resolveObjectURL } from 'buffer'; | ||
this.parse(url, false); | ||
if (url.startsWith('http://[') || url.startsWith('https://[')) { | ||
this.hostname = `[${this.hostname}]`; | ||
} | ||
if (base) { | ||
@@ -48,2 +51,5 @@ const baseParsed = typeof base === 'string' ? new PonyfillURL(base) : base; | ||
toString() { | ||
if (this._searchParams) { | ||
this.search = this._searchParams.toString(); | ||
} | ||
return this.format(); | ||
@@ -50,0 +56,0 @@ } |
{ | ||
"name": "@whatwg-node/node-fetch", | ||
"version": "0.7.4", | ||
"version": "0.7.5-alpha-20241210190244-f8654a00cd5b6a4eda10e114502523848eaec29f", | ||
"description": "Fetch API implementation for Node", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -22,2 +22,3 @@ interface BlobOptions { | ||
arrayBuffer(): Promise<ArrayBuffer>; | ||
size?: number; | ||
}; | ||
@@ -45,3 +46,3 @@ export declare function hasBytesMethod(obj: any): obj is { | ||
_buffer: Buffer | null; | ||
buffer(): Promise<Buffer>; | ||
buffer(): Promise<Buffer<ArrayBufferLike>>; | ||
arrayBuffer(): Promise<ArrayBuffer>; | ||
@@ -48,0 +49,0 @@ bytes(): Promise<Uint8Array>; |
@@ -35,3 +35,3 @@ import { Readable } from 'stream'; | ||
_chunks: Uint8Array[] | null; | ||
_collectChunksFromReadable(): Promise<Uint8Array[]>; | ||
_collectChunksFromReadable(): Promise<Uint8Array<ArrayBufferLike>[]>; | ||
_blob: PonyfillBlob | null; | ||
@@ -38,0 +38,0 @@ blob(): Promise<PonyfillBlob>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
231254
5950