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

search-params

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

search-params - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

2

dist/search-params.cjs.development.js

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

var decodeValue = function decodeValue(value) {
return decodeURIComponent(value.replace('+', ' '));
return decodeURIComponent(value.replace(/\+/g, ' '));
};

@@ -25,0 +25,0 @@

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=function(r){return void 0===r&&(r={}),{arrayFormat:r.arrayFormat||"none",booleanFormat:r.booleanFormat||"none",nullFormat:r.nullFormat||"default"}},n=function(r){return encodeURIComponent(r)},t=function(r){return decodeURIComponent(r.replace("+"," "))},e=function(r){var n=r.indexOf("?");return-1===n?r:r.slice(n+1)},o=function(r){var n=r.indexOf("["),t=-1!==n;return{hasBrackets:t,name:t?r.slice(0,n):r}},u=function(n,u){var a=r(u);return e(n).split("&").reduce((function(r,n){var e=n.split("="),u=e[1],i=o(e[0]),c=i.hasBrackets,l=i.name,f=t(l),s=r[l],m=function(r,n){if(void 0===r)return"empty-true"===n.booleanFormat||null;if("string"===n.booleanFormat){if("true"===r)return!0;if("false"===r)return!1}if("string"===n.nullFormat&&"null"===r)return null;var e=t(r);if("unicode"===n.booleanFormat){if("✓"===e)return!0;if("✗"===e)return!1}return e}(u,a);return r[f]=void 0===s?c?[m]:m:(Array.isArray(s)?s:[s]).concat(m),r}),{})};exports.build=function(t,e){var o=r(e);return Object.keys(t).filter((function(r){return void 0!==t[r]})).map((function(r){return function(r,t,e){var o=n(r);return null===t?function(r,n){return"hidden"===n.nullFormat?"":"string"===n.nullFormat?r+"=null":r}(o,e):"boolean"==typeof t?function(r,n,t){return"empty-true"===t.booleanFormat&&n?r:r+"="+("unicode"===t.booleanFormat?n?"✓":"✗":n.toString())}(o,t,e):Array.isArray(t)?function(r,t,e){var o=function(r){return"index"===r.arrayFormat?function(r,n){return r+"["+n+"]"}:"brackets"===r.arrayFormat?function(r){return r+"[]"}:function(r){return r}}(e);return t.map((function(t,e){return o(r,e)+"="+n(t)})).join("&")}(o,t,e):o+"="+n(t)}(r,t[r],o)})).filter(Boolean).join("&")},exports.keep=function(n,t,a){var i=r(a);if(""===e(n))return{keptParams:{},querystring:""};var c=n.split("&").reduce((function(r,n){var e=n.split("=")[0],u=o(e).name;return t.includes(u)&&r.push(n),r}),[]);return{keptParams:u(c.join("&"),i),querystring:c.join("&")}},exports.omit=function(n,t,a){var i=r(a);if(""===e(n))return{querystring:"",removedParams:{}};var c=n.split("&").reduce((function(r,n){var e=r[0],u=r[1],a=n.split("=")[0],i=o(a).name;return-1===t.indexOf(i)?[e.concat(n),u]:[e,u.concat(n)]}),[[],[]]),l=c[1];return{querystring:c[0].join("&"),removedParams:u(l.join("&"),i)}},exports.parse=u;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=function(r){return void 0===r&&(r={}),{arrayFormat:r.arrayFormat||"none",booleanFormat:r.booleanFormat||"none",nullFormat:r.nullFormat||"default"}},n=function(r){return encodeURIComponent(r)},t=function(r){return decodeURIComponent(r.replace(/\+/g," "))},e=function(r){var n=r.indexOf("?");return-1===n?r:r.slice(n+1)},o=function(r){var n=r.indexOf("["),t=-1!==n;return{hasBrackets:t,name:t?r.slice(0,n):r}},u=function(n,u){var a=r(u);return e(n).split("&").reduce((function(r,n){var e=n.split("="),u=e[1],i=o(e[0]),c=i.hasBrackets,l=i.name,f=t(l),s=r[l],m=function(r,n){if(void 0===r)return"empty-true"===n.booleanFormat||null;if("string"===n.booleanFormat){if("true"===r)return!0;if("false"===r)return!1}if("string"===n.nullFormat&&"null"===r)return null;var e=t(r);if("unicode"===n.booleanFormat){if("✓"===e)return!0;if("✗"===e)return!1}return e}(u,a);return r[f]=void 0===s?c?[m]:m:(Array.isArray(s)?s:[s]).concat(m),r}),{})};exports.build=function(t,e){var o=r(e);return Object.keys(t).filter((function(r){return void 0!==t[r]})).map((function(r){return function(r,t,e){var o=n(r);return null===t?function(r,n){return"hidden"===n.nullFormat?"":"string"===n.nullFormat?r+"=null":r}(o,e):"boolean"==typeof t?function(r,n,t){return"empty-true"===t.booleanFormat&&n?r:r+"="+("unicode"===t.booleanFormat?n?"✓":"✗":n.toString())}(o,t,e):Array.isArray(t)?function(r,t,e){var o=function(r){return"index"===r.arrayFormat?function(r,n){return r+"["+n+"]"}:"brackets"===r.arrayFormat?function(r){return r+"[]"}:function(r){return r}}(e);return t.map((function(t,e){return o(r,e)+"="+n(t)})).join("&")}(o,t,e):o+"="+n(t)}(r,t[r],o)})).filter(Boolean).join("&")},exports.keep=function(n,t,a){var i=r(a);if(""===e(n))return{keptParams:{},querystring:""};var c=n.split("&").reduce((function(r,n){var e=n.split("=")[0],u=o(e).name;return t.includes(u)&&r.push(n),r}),[]);return{keptParams:u(c.join("&"),i),querystring:c.join("&")}},exports.omit=function(n,t,a){var i=r(a);if(""===e(n))return{querystring:"",removedParams:{}};var c=n.split("&").reduce((function(r,n){var e=r[0],u=r[1],a=n.split("=")[0],i=o(a).name;return-1===t.indexOf(i)?[e.concat(n),u]:[e,u.concat(n)]}),[[],[]]),l=c[1];return{querystring:c[0].join("&"),removedParams:u(l.join("&"),i)}},exports.parse=u;
//# sourceMappingURL=search-params.cjs.production.min.js.map

@@ -18,3 +18,3 @@ var makeOptions = function makeOptions(opts) {

var decodeValue = function decodeValue(value) {
return decodeURIComponent(value.replace('+', ' '));
return decodeURIComponent(value.replace(/\+/g, ' '));
};

@@ -21,0 +21,0 @@

{
"name": "search-params",
"version": "4.0.0",
"version": "4.0.1",
"description": "A module to manipulate search part of URLs (querystring)",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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