Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

url-search-params-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-search-params-polyfill - npm Package Compare versions

Comparing version 8.1.1 to 8.2.0

23

index.js

@@ -1,9 +0,7 @@

/**
/**!
* url-search-params-polyfill
*
*
* @author Jerry Bendy <jerry@icewingcc.com>
* @author Jerry Bendy (https://github.com/jerrybendy)
* @licence MIT
*
*/
(function(self) {

@@ -24,2 +22,3 @@ 'use strict';

decodesPlusesCorrectly = nativeURLSearchParams && (new nativeURLSearchParams('s=%2B').get('s') === '+'),
isSupportSize = !!nativeURLSearchParams.prototype.size,
__URLSearchParams__ = "__URLSearchParams__",

@@ -35,3 +34,3 @@ // Fix bug in Edge which cannot encode ' &' correctly

if (nativeURLSearchParams && isSupportObjectConstructor && decodesPlusesCorrectly && encodesAmpersandsCorrectly) {
if (nativeURLSearchParams && isSupportObjectConstructor && decodesPlusesCorrectly && encodesAmpersandsCorrectly && isSupportSize) {
return;

@@ -155,3 +154,3 @@ }

/*
* Apply polifill to global object and append other prototype into it
* Apply polyfill to global object and append other prototype into it
*/

@@ -248,2 +247,12 @@ Object.defineProperty(self, 'URLSearchParams', {

if (!USPProto.size) {
Object.defineProperty(USPProto, 'size', {
get: function () {
var that = this
return Object.keys(this[__URLSearchParams__]).reduce(function (prev, cur) {
return prev + that[__URLSearchParams__][cur].length;
}, 0);
}
});
}

@@ -250,0 +259,0 @@ function encode(str) {

{
"name": "url-search-params-polyfill",
"version": "8.1.1",
"version": "8.2.0",
"description": "a simple polyfill for javascript URLSearchParams",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/jerrybendy/url-search-params-polyfill",

@@ -148,2 +148,7 @@ # URLSearchParams Polyfill [![](https://img.shields.io/npm/v/url-search-params-polyfill.svg)](https://www.npmjs.com/package/url-search-params-polyfill)

### size
```javascript
console.log(search.size)
```
## Known Issues

@@ -150,0 +155,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc