MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / Headers

Function Headers

packages/core/fetch/index.mjs:82–98  ·  view source on GitHub ↗
(headers)

Source from the content-addressed store, hash-verified

80 }
81
82 function Headers(headers) {
83 this.map = {};
84
85 if (headers instanceof Headers) {
86 headers.forEach(function (value, name) {
87 this.append(name, value);
88 }, this);
89 } else if (Array.isArray(headers)) {
90 headers.forEach(function (header) {
91 this.append(header[0], header[1]);
92 }, this);
93 } else if (headers) {
94 Object.getOwnPropertyNames(headers).forEach(function (name) {
95 this.append(name, headers[name]);
96 }, this);
97 }
98 }
99
100 Headers.prototype.append = function (name, value) {
101 name = normalizeName(name);

Callers

nothing calls this directly

Calls 2

forEachMethod · 0.80
appendMethod · 0.65

Tested by

no test coverage detected