Skip to content

Commit

Permalink
replace querystring lib with URLSearchParams
Browse files Browse the repository at this point in the history
  • Loading branch information
higginsrob committed Feb 4, 2022
1 parent fa1ed72 commit 61fc38f
Show file tree
Hide file tree
Showing 6 changed files with 1,671 additions and 1,246 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Logs
logs
build
dist
*.log
npm-debug.log*
yarn-debug.log*
Expand Down
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const qs = require('querystring');

const factory = function(tag, props, ns) {
if (!tag) {
return;
Expand Down Expand Up @@ -317,7 +315,13 @@ svgElements.forEach(elem => {
svgFactory[elem.toLowerCase()] = svgFactory[elem];
});

const query = window && qs.parse(window.location.search.substr(1));
// window query
const query = (module.exports.query = {});
const searchParams = new URLSearchParams(document.location.search);
searchParams.forEach((key, value) => {
query[key] = value;
});

module.exports.Inputs = function(inputs) {
if (Array.isArray(inputs)) {
const container = domFactory.DIV({className: 'jdom-inputs-container'});
Expand Down

0 comments on commit 61fc38f

Please sign in to comment.