MCPcopy Create free account
hub / github.com/nodejs/node / buildHeadersFromArray

Function buildHeadersFromArray

deps/undici/src/lib/mock/mock-utils.js:63–70  ·  view source on GitHub ↗

@param {string[]} headers

(headers)

Source from the content-addressed store, hash-verified

61
62/** @param {string[]} headers */
63function buildHeadersFromArray (headers) { // fetch HeadersList
64 const clone = headers.slice()
65 const entries = []
66 for (let index = 0; index < clone.length; index += 2) {
67 entries.push([clone[index], clone[index + 1]])
68 }
69 return Object.fromEntries(entries)
70}
71
72function matchHeaders (mockDispatch, headers) {
73 if (typeof mockDispatch.headers === 'function') {

Callers 2

matchHeadersFunction · 0.85
handleReplyFunction · 0.85

Calls 2

sliceMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected