Skip to content

Commit

Permalink
Update UPI QR code generation logic and bump version to 1.3.20
Browse files Browse the repository at this point in the history
  • Loading branch information
bhar4t committed Jan 3, 2025
1 parent 29fcc81 commit 27c3eaa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "upiqr",
"version": "1.3.19",
"version": "1.3.20",
"description": "Generate NPCI's UPI QR code along with UPI intent link, By using it any payment is possible from UPI enabled apps.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
6 changes: 1 addition & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ export default function upiqr ({

// IIFE: builds and returns the UPI intent URL by given params.
const intent = ((params: object): string => {
const urlParams = new URLSearchParams()
for (const [key, value] of Object.entries(params)) {
if (value)
urlParams.append(key, value as string)
}
const urlParams = new URLSearchParams(Object.entries(params).filter(([_, value]) => value))
return `upi://pay?${urlParams.toString()}`
})(params);

Expand Down

0 comments on commit 27c3eaa

Please sign in to comment.