browser-headers
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -142,9 +142,14 @@ "use strict"; | ||
BrowserHeaders.prototype.toHeaders = function () { | ||
var headers = new Headers(); | ||
this.forEach(function (key, values) { | ||
values.forEach(function (value) { | ||
headers.append(key, value); | ||
if (typeof Headers !== "undefined") { | ||
var headers_1 = new Headers(); | ||
this.forEach(function (key, values) { | ||
values.forEach(function (value) { | ||
headers_1.append(key, value); | ||
}); | ||
}); | ||
}); | ||
return headers; | ||
return headers_1; | ||
} | ||
else { | ||
throw new Error("Headers class is not defined"); | ||
} | ||
}; | ||
@@ -151,0 +156,0 @@ return BrowserHeaders; |
{ | ||
"name": "browser-headers", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "types": "lib/index.d.ts", |
@@ -164,11 +164,13 @@ import { normalizeName, normalizeValue, getHeaderValues, getHeaderKeys, splitHeaderValue } from "./util"; | ||
toHeaders(): WindowHeaders { | ||
const headers: WindowHeaders = new Headers(); | ||
this.forEach((key, values) => { | ||
values.forEach(value => { | ||
headers.append(key, value); | ||
if (typeof Headers !== "undefined") { | ||
const headers: WindowHeaders = new Headers(); | ||
this.forEach((key, values) => { | ||
values.forEach(value => { | ||
headers.append(key, value); | ||
}); | ||
}); | ||
}); | ||
return headers; | ||
return headers; | ||
} else { | ||
throw new Error("Headers class is not defined"); | ||
} | ||
} | ||
@@ -175,0 +177,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42378
685