Skip to content

Commit 01a7a85

Browse files
committed
Fix whitespace
1 parent 7b1e746 commit 01a7a85

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

packages/fetch/src/headers.js

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,24 @@ export default HeadersPolyfill;
5151
* @param {import('http').IncomingMessage['rawHeaders']} headers
5252
*/
5353
export function fromRawHeaders(headers = []) {
54-
let init = headers
55-
// Split into pairs
56-
.reduce((result, _, index, array) => {
57-
if (index % 2 === 0) {
58-
let [k, v] = array.slice(index, index + 2);
59-
result.push([k, v]);
60-
}
61-
return result;
62-
}, /** @type {[string, string][]} */([]))
63-
.filter(([name, value]) => {
64-
try {
65-
validateHeaderName(name);
66-
validateHeaderValue(name, String(value));
67-
return true;
68-
} catch {
69-
return false;
70-
}
71-
});
72-
return new HeadersPolyfill(init);
54+
return new HeadersPolyfill(
55+
headers
56+
// Split into pairs
57+
.reduce((result, value, index, array) => {
58+
if (index % 2 === 0) {
59+
let [k, v] = array.slice(index, index + 2);
60+
result.push([k, v]);
61+
}
62+
return result;
63+
}, /** @type {[string, string][]} */([]))
64+
.filter(([name, value]) => {
65+
try {
66+
validateHeaderName(name);
67+
validateHeaderValue(name, String(value));
68+
return true;
69+
} catch {
70+
return false;
71+
}
72+
})
73+
);
7374
}

0 commit comments

Comments
 (0)