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

get-param-by-name

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-param-by-name - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

yarn.lock

12

dist/index.js

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

export default function (search) {
"use strict";
var getParamByName = function getParamByName(search) {
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.href;

@@ -9,2 +11,10 @@ var name = search.replace(/[\[\]]/g, '\\$&');

return decodeURIComponent(results[2].replace(/\+/g, ' '));
};
if (typeof module !== 'undefined' && module.exports) {
module.exports = getParamByName;
} else if (typeof define === 'function' && define.amd) {
define('getParamByName', [], function (require, exports, module) {
return getParamByName;
});
}

11

package.json
{
"name": "get-param-by-name",
"version": "1.0.1",
"version": "1.0.2",
"description": "A JavaScript utility for retrieving a parameter value by name from a URL.",

@@ -27,8 +27,11 @@ "main": "dist/index.js",

"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"babel-jest": "^23.6.0",
"babel-preset-env": "^1.7.0",
"jest": "^23.6.0"
},
"resolutions": {
"@babel/core": "7.0.0-bridge.0"
},
"jest": {

@@ -35,0 +38,0 @@ "moduleFileExtensions": [

# get-param-by-name
![npm](https://img.shields.io/npm/v/get-param-by-name.svg)
[![npm](https://img.shields.io/npm/v/get-param-by-name.svg)](https://www.npmjs.com/package/get-param-by-name)
![CircleCI (all branches)](https://img.shields.io/circleci/project/github/mhfen/get-param-by-name/master.svg)

@@ -36,3 +36,3 @@ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

```bash
$ npm install
$ yarn
```

@@ -43,3 +43,3 @@

```bash
$ npm test
$ yarn test
```

@@ -50,3 +50,3 @@

```bash
$ npm run build
$ yarn build
```

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

export default function(search, url = window.location.href) {
const getParamByName = function(search, url = window.location.href) {
const name = search.replace(/[\[\]]/g, '\\$&');

@@ -10,2 +10,10 @@ const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');

return decodeURIComponent(results[2].replace(/\+/g, ' '));
};
if (typeof module !== 'undefined' && module.exports) {
module.exports = getParamByName;
} else if (typeof define === 'function' && define.amd) {
define('getParamByName', [], function(require, exports, module) {
return getParamByName;
});
}

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