whatwg-fetch
Advanced tools
Comparing version 1.1.0 to 2.0.0
28
fetch.js
@@ -98,8 +98,4 @@ (function(self) { | ||
value = normalizeValue(value) | ||
var list = this.map[name] | ||
if (!list) { | ||
list = [] | ||
this.map[name] = list | ||
} | ||
list.push(value) | ||
var oldValue = this.map[name] | ||
this.map[name] = oldValue ? oldValue+','+value : value | ||
} | ||
@@ -112,10 +108,6 @@ | ||
Headers.prototype.get = function(name) { | ||
var values = this.map[normalizeName(name)] | ||
return values ? values[0] : null | ||
name = normalizeName(name) | ||
return this.has(name) ? this.map[name] : null | ||
} | ||
Headers.prototype.getAll = function(name) { | ||
return this.map[normalizeName(name)] || [] | ||
} | ||
Headers.prototype.has = function(name) { | ||
@@ -126,11 +118,11 @@ return this.map.hasOwnProperty(normalizeName(name)) | ||
Headers.prototype.set = function(name, value) { | ||
this.map[normalizeName(name)] = [normalizeValue(value)] | ||
this.map[normalizeName(name)] = normalizeValue(value) | ||
} | ||
Headers.prototype.forEach = function(callback, thisArg) { | ||
Object.getOwnPropertyNames(this.map).forEach(function(name) { | ||
this.map[name].forEach(function(value) { | ||
callback.call(thisArg, value, name, this) | ||
}, this) | ||
}, this) | ||
for (var name in this.map) { | ||
if (this.map.hasOwnProperty(name)) { | ||
callback.call(thisArg, this.map[name], name, this) | ||
} | ||
} | ||
} | ||
@@ -137,0 +129,0 @@ |
{ | ||
"name": "whatwg-fetch", | ||
"description": "A window.fetch polyfill.", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"main": "fetch.js", | ||
@@ -6,0 +6,0 @@ "repository": "github/fetch", |
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
22544
385