querystring-minilib
Advanced tools
Comparing version 0.3.0 to 1.0.0
{ | ||
"name": "querystring-minilib", | ||
"version": "0.3.0", | ||
"version": "1.0.0", | ||
"description": "Mini library for dealing with query string params", | ||
@@ -5,0 +5,0 @@ "main": "querystring.js", |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";var n={};n.delayedPush="",n.get=function(n){var e=new RegExp("[?&]"+n+"=([^&#]*)").exec(window.location.href);return null===e?null:decodeURIComponent(e[1])||0},n.parse=function(n){return"string"!=typeof n?{}:(n=n.trim().replace(/^\?/,""),n?n.trim().split("&").reduce(function(n,e){var o=e.replace(/\+/g," ").split("="),r=o[0],t=o[1];return r=decodeURIComponent(r),t=void 0===t?null:decodeURIComponent(t),n.hasOwnProperty(r)?Array.isArray(n[r])?n[r].push(t):n[r]=[n[r],t]:n[r]=t,n},{}):{})},n.stringify=function(n){return n?Object.keys(n).map(function(e){var o=n[e];return Array.isArray(o)?o.map(function(n){return encodeURIComponent(e)+"="+encodeURIComponent(n)}).join("&"):encodeURIComponent(e)+"="+encodeURIComponent(o)}).join("&"):""},n.clean=function(s){if(s){for(var t=s.split("&"),u=[],i=0;i<t.length;i++)t[i].indexOf("=")+1!=t[i].length&&t[i].indexOf("undefined")<0&&u.push(t[i]);return u.join("&")}return""},n.remove=function(e){for(var u=[],t=location.search.replace("?","").split("&"),i=0;i<t.length;i++)t[i].indexOf(e+"=")<0&&u.push(t[i]);u=n.clean(u.join("&")),history.pushState({},"",window.location.pathname+"?"+u)},n.add=function(e,o){n.push(e,o)},n.push=function(e,o){var u=[],r=n.parse(location.search);r[e]=o;for(var v in r)u.push(v+"="+r[v]);var t=n.clean(u.join("&"));history.pushState({},"",window.location.pathname+"?"+t)},"undefined"!=typeof module&&module.exports?module.exports=n:window.queryString=n}(); | ||
!function(){"use strict";var n={};n.delayedPush="",n.get=function(n){if(void 0==n){var search=location.search;return this.parseSearch(search)}var e=new RegExp("[?&]"+n+"=([^&#]*)").exec(window.location.href);return null===e?null:decodeURIComponent(e[1])||0},n.parseSearch=function(search){if(!search)return{};try{search=JSON.parse('{"'+decodeURI(search.substring(1)).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')}catch(e){search=null}for(var key in search)search.hasOwnProperty(key)&&(search[key]=decodeURIComponent(search[key]));return search},n.parse=function(n){return"string"!=typeof n?{}:(n=n.trim().replace(/^\?/,""),n?n.trim().split("&").reduce(function(n,e){var o=e.replace(/\+/g," ").split("="),r=o[0],t=o[1];return r=decodeURIComponent(r),t=void 0===t?null:decodeURIComponent(t),n.hasOwnProperty(r)?Array.isArray(n[r])?n[r].push(t):n[r]=[n[r],t]:n[r]=t,n},{}):{})},n.stringify=function(n){return n?Object.keys(n).map(function(e){var o=n[e];return Array.isArray(o)?o.map(function(n){return encodeURIComponent(e)+"="+encodeURIComponent(n)}).join("&"):encodeURIComponent(e)+"="+encodeURIComponent(o)}).join("&"):""},n.clean=function(s){if(s){for(var t=s.split("&"),u=[],i=0;i<t.length;i++)t[i].indexOf("=")+1!=t[i].length&&t[i].indexOf("undefined")<0&&u.push(t[i]);return u.join("&")}return""},n.remove=function(e){for(var u=[],t=location.search.replace("?","").split("&"),i=0;i<t.length;i++)t[i].indexOf(e+"=")<0&&u.push(t[i]);u=n.clean(u.join("&")),history.replaceState({},"",window.location.pathname+"?"+u)},n.removeAll=function(){history.replaceState({},"",window.location.pathname)},n.add=function(e,o){n.push(e,o)},n.push=function(e,o){var u=[],r=n.parse(location.search);r[e]=o;for(var v in r)u.push(v+"="+encodeURIComponent(r[v]));var t=n.clean(u.join("&"));try{history.replaceState({},"",window.location.pathname+"?"+t)}catch(e){-1!==e.toString().indexOf("DOM Exception 18")&&window.location.reload()}},"undefined"!=typeof module&&module.exports?module.exports=n:window.queryString=n}(); |
@@ -1,2 +0,2 @@ | ||
# querystring | ||
# ispot.tv-querystring | ||
Mini library for dealing with query string params |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
6685
99
1