get-param-by-name
Advanced tools
Comparing version 1.0.2 to 1.0.4
@@ -1,10 +0,13 @@ | ||
"use strict"; | ||
'use strict'; | ||
var getParamByName = function getParamByName(search) { | ||
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.href; | ||
var name = search.replace(/[\[\]]/g, '\\$&'); | ||
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'); | ||
var results = regex.exec(url); | ||
if (!results) return null; | ||
if (!results[2]) return ''; | ||
return decodeURIComponent(results[2].replace(/\+/g, ' ')); | ||
@@ -11,0 +14,0 @@ }; |
{ | ||
"name": "get-param-by-name", | ||
"version": "1.0.2", | ||
"version": "1.0.4", | ||
"description": "A JavaScript utility for retrieving a parameter value by name from a URL.", | ||
@@ -27,11 +27,8 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@babel/cli": "^7.1.5", | ||
"@babel/core": "^7.1.6", | ||
"@babel/preset-env": "^7.1.6", | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.3", | ||
"babel-jest": "^23.6.0", | ||
"babel-preset-env": "^1.7.0", | ||
"jest": "^23.6.0" | ||
}, | ||
"resolutions": { | ||
"@babel/core": "7.0.0-bridge.0" | ||
}, | ||
"jest": { | ||
@@ -38,0 +35,0 @@ "moduleFileExtensions": [ |
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
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
174511