MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / getHeader

Function getHeader

example/tests/gm_xhr_test.js:1952–1956  ·  view source on GitHub ↗
(headersStr, key)

Source from the content-addressed store, hash-verified

1950 if (aj !== bj) throw new Error(msg ? `${msg}: expected ${bj}, got ${aj}` : `deep equal failed`);
1951 }
1952 function getHeader(headersStr, key) {
1953 const lines = (headersStr || "").split(/\r?\n/);
1954 const line = lines.find((l) => l.toLowerCase().startsWith(key.toLowerCase() + ":"));
1955 return line ? line.split(":").slice(1).join(":").trim() : "";
1956 }
1957 function objectProps(o) {
1958 if (!o || typeof o !== "object") return "not an object";
1959 let z, oD, zD;

Callers

nothing calls this directly

Calls 1

sliceMethod · 0.45

Tested by

no test coverage detected