Socket
Socket
Sign inDemoInstall

query-params-parser

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.5 to 0.1.6

index.test.js

2

index.js
export default function parseParams(baseObject, params = new URLSearchParams(window.location.search), arrSeparator = ',') {
if(!baseObject || typeof(baseObject) !== 'object') throw new Error('baseObject property must be declared and a object');
if(!params?.get) throw new Error('search params must be initialized like "new URLSearchParams(query)"');
if(!arrSeparator) throw new Error('arr separator must not be empty');
if(!baseObject || typeof(baseObject) !== 'object') throw new Error('baseObject property must be declared and a object');

@@ -6,0 +6,0 @@ const obj = {};

{
"name": "query-params-parser",
"author": "Lucas Levandoski",
"version": "0.1.5",
"version": "0.1.6",
"description": "A simple library to parse query params into proper types",
"main": "index.js",
"type": "module",
"types": "index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "node index.test.js"
},

@@ -11,0 +12,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc