@whatwg-node/node-fetch 0.7.20-alpha-20250515122304-c3917d634d31f6588a63ebde75cc785bd86aed38 → 0.7.20-alpha-20250515123934-037460f929f788c2d3902d4d68aca61757f84761

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/Headers.js CHANGED
@@ -142,6 +142,30 @@ class PonyfillHeaders {
142
142
  this._setCookies = [value];
143
143
  return;
144
144
  }
145
+ if (this._map) {
146
+ this._map.set(key, value);
147
+ return;
148
+ }
149
+ if (this.headersInit != null) {
150
+ if (Array.isArray(this.headersInit)) {
151
+ const found = this.headersInit.find(([headerKey]) => headerKey.toLowerCase() === key);
152
+ if (found) {
153
+ found[1] = value;
154
+ }
155
+ else {
156
+ this.headersInit.push([key, value]);
157
+ }
158
+ return;
159
+ }
160
+ else if (isHeadersLike(this.headersInit)) {
161
+ this.headersInit.set(key, value);
162
+ return;
163
+ }
164
+ else {
165
+ this.headersInit[key] = value;
166
+ return;
167
+ }
168
+ }
145
169
  this.getMap().set(key, value);
146
170
  }
147
171
  delete(name) {
package/esm/Headers.js CHANGED
@@ -138,6 +138,30 @@ export class PonyfillHeaders {
138
138
  this._setCookies = [value];
139
139
  return;
140
140
  }
141
+ if (this._map) {
142
+ this._map.set(key, value);
143
+ return;
144
+ }
145
+ if (this.headersInit != null) {
146
+ if (Array.isArray(this.headersInit)) {
147
+ const found = this.headersInit.find(([headerKey]) => headerKey.toLowerCase() === key);
148
+ if (found) {
149
+ found[1] = value;
150
+ }
151
+ else {
152
+ this.headersInit.push([key, value]);
153
+ }
154
+ return;
155
+ }
156
+ else if (isHeadersLike(this.headersInit)) {
157
+ this.headersInit.set(key, value);
158
+ return;
159
+ }
160
+ else {
161
+ this.headersInit[key] = value;
162
+ return;
163
+ }
164
+ }
141
165
  this.getMap().set(key, value);
142
166
  }
143
167
  delete(name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.7.20-alpha-20250515122304-c3917d634d31f6588a63ebde75cc785bd86aed38",
3
+ "version": "0.7.20-alpha-20250515123934-037460f929f788c2d3902d4d68aca61757f84761",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "dependencies": {