url-search-params-polyfill
Advanced tools
Comparing version 8.2.4 to 8.2.5
99
index.js
@@ -172,10 +172,12 @@ /**! | ||
*/ | ||
USPProto.forEach = USPProto.forEach || function(callback, thisArg) { | ||
var dict = parseToDict(this.toString()); | ||
Object.getOwnPropertyNames(dict).forEach(function(name) { | ||
dict[name].forEach(function(value) { | ||
callback.call(thisArg, value, name, this); | ||
if (!('forEach' in USPProto)) { | ||
USPProto.forEach = function(callback, thisArg) { | ||
var dict = parseToDict(this.toString()); | ||
Object.getOwnPropertyNames(dict).forEach(function(name) { | ||
dict[name].forEach(function(value) { | ||
callback.call(thisArg, value, name, this); | ||
}, this); | ||
}, this); | ||
}, this); | ||
}; | ||
}; | ||
} | ||
@@ -185,19 +187,21 @@ /** | ||
*/ | ||
USPProto.sort = USPProto.sort || function() { | ||
var dict = parseToDict(this.toString()), keys = [], k, i, j; | ||
for (k in dict) { | ||
keys.push(k); | ||
} | ||
keys.sort(); | ||
if (!('sort' in USPProto)) { | ||
USPProto.sort = function() { | ||
var dict = parseToDict(this.toString()), keys = [], k, i, j; | ||
for (k in dict) { | ||
keys.push(k); | ||
} | ||
keys.sort(); | ||
for (i = 0; i < keys.length; i++) { | ||
this['delete'](keys[i]); | ||
} | ||
for (i = 0; i < keys.length; i++) { | ||
var key = keys[i], values = dict[key]; | ||
for (j = 0; j < values.length; j++) { | ||
this.append(key, values[j]); | ||
for (i = 0; i < keys.length; i++) { | ||
this['delete'](keys[i]); | ||
} | ||
} | ||
}; | ||
for (i = 0; i < keys.length; i++) { | ||
var key = keys[i], values = dict[key]; | ||
for (j = 0; j < values.length; j++) { | ||
this.append(key, values[j]); | ||
} | ||
} | ||
}; | ||
} | ||
@@ -210,9 +214,11 @@ /** | ||
*/ | ||
USPProto.keys = USPProto.keys || function() { | ||
var items = []; | ||
this.forEach(function(item, name) { | ||
items.push(name); | ||
}); | ||
return makeIterator(items); | ||
}; | ||
if (!('keys' in USPProto)) { | ||
USPProto.keys = function() { | ||
var items = []; | ||
this.forEach(function(item, name) { | ||
items.push(name); | ||
}); | ||
return makeIterator(items); | ||
}; | ||
} | ||
@@ -225,9 +231,11 @@ /** | ||
*/ | ||
USPProto.values = USPProto.values || function() { | ||
var items = []; | ||
this.forEach(function(item) { | ||
items.push(item); | ||
}); | ||
return makeIterator(items); | ||
}; | ||
if (!('values' in USPProto)) { | ||
USPProto.values = function() { | ||
var items = []; | ||
this.forEach(function(item) { | ||
items.push(item); | ||
}); | ||
return makeIterator(items); | ||
}; | ||
} | ||
@@ -240,11 +248,12 @@ /** | ||
*/ | ||
USPProto.entries = USPProto.entries || function() { | ||
var items = []; | ||
this.forEach(function(item, name) { | ||
items.push([name, item]); | ||
}); | ||
return makeIterator(items); | ||
}; | ||
if (!('entries' in USPProto)) { | ||
USPProto.entries = function() { | ||
var items = []; | ||
this.forEach(function(item, name) { | ||
items.push([name, item]); | ||
}); | ||
return makeIterator(items); | ||
}; | ||
} | ||
if (iterable) { | ||
@@ -254,3 +263,3 @@ USPProto[self.Symbol.iterator] = USPProto[self.Symbol.iterator] || USPProto.entries; | ||
if (!USPProto.size) { | ||
if (!('size' in USPProto)) { | ||
Object.defineProperty(USPProto, 'size', { | ||
@@ -257,0 +266,0 @@ get: function () { |
{ | ||
"name": "url-search-params-polyfill", | ||
"version": "8.2.4", | ||
"version": "8.2.5", | ||
"description": "a simple polyfill for javascript URLSearchParams", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/jerrybendy/url-search-params-polyfill", |
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
17368
337