@whatwg-node/node-fetch
Advanced tools
Comparing version 0.3.4 to 0.3.5-alpha-20230417094550-b36ed97
@@ -75,3 +75,4 @@ "use strict"; | ||
: null); | ||
const nodeHeaders = (0, utils_js_1.getHeadersObj)(fetchRequest.headers); | ||
const headersSerializer = fetchRequest.headersSerializer || utils_js_1.getHeadersObj; | ||
const nodeHeaders = headersSerializer(fetchRequest.headers); | ||
const abortListener = function abortListener(event) { | ||
@@ -78,0 +79,0 @@ nodeRequest.destroy(); |
@@ -7,2 +7,3 @@ "use strict"; | ||
const Headers_js_1 = require("./Headers.js"); | ||
const utils_js_1 = require("./utils.js"); | ||
function isRequest(input) { | ||
@@ -46,2 +47,3 @@ return input[Symbol.toStringTag] === 'Request'; | ||
this.signal = (requestInit === null || requestInit === void 0 ? void 0 : requestInit.signal) || new AbortController_js_1.PonyfillAbortController().signal; | ||
this.headersSerializer = (requestInit === null || requestInit === void 0 ? void 0 : requestInit.headersSerializer) || utils_js_1.getHeadersObj; | ||
this.url = url || ''; | ||
@@ -48,0 +50,0 @@ const contentTypeInHeaders = this.headers.get('content-type'); |
@@ -72,3 +72,4 @@ import { createReadStream } from 'fs'; | ||
: null); | ||
const nodeHeaders = getHeadersObj(fetchRequest.headers); | ||
const headersSerializer = fetchRequest.headersSerializer || getHeadersObj; | ||
const nodeHeaders = headersSerializer(fetchRequest.headers); | ||
const abortListener = function abortListener(event) { | ||
@@ -75,0 +76,0 @@ nodeRequest.destroy(); |
import { PonyfillAbortController } from './AbortController.js'; | ||
import { PonyfillBody } from './Body.js'; | ||
import { PonyfillHeaders } from './Headers.js'; | ||
import { getHeadersObj } from './utils.js'; | ||
function isRequest(input) { | ||
@@ -42,2 +43,3 @@ return input[Symbol.toStringTag] === 'Request'; | ||
this.signal = (requestInit === null || requestInit === void 0 ? void 0 : requestInit.signal) || new PonyfillAbortController().signal; | ||
this.headersSerializer = (requestInit === null || requestInit === void 0 ? void 0 : requestInit.headersSerializer) || getHeadersObj; | ||
this.url = url || ''; | ||
@@ -44,0 +46,0 @@ const contentTypeInHeaders = this.headers.get('content-type'); |
{ | ||
"name": "@whatwg-node/node-fetch", | ||
"version": "0.3.4", | ||
"version": "0.3.5-alpha-20230417094550-b36ed97", | ||
"description": "Fetch API implementation for Node", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -6,5 +6,8 @@ import { BodyPonyfillInit, PonyfillBody, PonyfillBodyOptions } from './Body.js'; | ||
headers?: PonyfillHeadersInit; | ||
headersSerializer?: HeadersSerializer; | ||
}; | ||
type HeadersSerializer = (headers: Headers) => Record<string, string>; | ||
export declare class PonyfillRequest<TJSON = any> extends PonyfillBody<TJSON> implements Request { | ||
constructor(input: RequestInfo | URL, options?: RequestPonyfillInit); | ||
headersSerializer: HeadersSerializer; | ||
cache: RequestCache; | ||
@@ -26,1 +29,2 @@ credentials: RequestCredentials; | ||
} | ||
export {}; |
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
135112
3280