Skip to content

Commit

Permalink
Added jsmin minify
Browse files Browse the repository at this point in the history
  • Loading branch information
bhar4t committed Dec 31, 2024
1 parent 06f73c9 commit a9f38f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 87 deletions.
10 changes: 1 addition & 9 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
import QRCode from 'qrcode';
import { QRResult, UPIIntentParams } from './types/upiqr';
/**
* Generates a UPI QR code and intent URL.
* @param {UPIIntentParams} params - The UPI intent parameters.
* @param {QRCode.QRCodeToDataURLOptions} [qrOptions] - Optional QR code generation options.
* @returns {Promise<QRResult>} - A promise that resolves to the QR code and intent URL.
*/
export default function upiqr({ payeeVPA: pa, payeeName: pn, payeeMerchantCode: mc, transactionId: tid, transactionRef: tr, transactionNote: tn, amount: am, minimumAmount: mam, currency: cu, }: UPIIntentParams, qrOptions?: QRCode.QRCodeToDataURLOptions): Promise<QRResult>;
import QRCode from'qrcode';import{QRResult,UPIIntentParams}from'./types/upiqr';export default function upiqr({payeeVPA:pa,payeeName:pn,payeeMerchantCode:mc,transactionId:tid,transactionRef:tr,transactionNote:tn,amount:am,minimumAmount:mam,currency:cu,}:UPIIntentParams,qrOptions?:QRCode.QRCodeToDataURLOptions):Promise<QRResult>;
53 changes: 8 additions & 45 deletions dist/index.js

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

34 changes: 3 additions & 31 deletions dist/types/upiqr.d.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
/**
* Supported image types for the QR code.
*/
export type ImageType = 'png' | 'jpeg' | 'webp';
/**
* Base64 encoded image string.
* @template imageType - The type of the image.
*/
export type Base64<imageType extends ImageType> = `data:image/${imageType};base64,${string}`;
/**
* Parameters for generating UPI intent.
*/
export interface UPIIntentParams {
payeeVPA: string;
payeeName: string;
payeeMerchantCode?: string;
transactionId?: string;
transactionRef?: string;
transactionNote?: string;
amount?: string;
minimumAmount?: string;
currency?: string;
transactionRefUrl?: string;
}
/**
* Result of the UPI QR code generation.
*/
export interface QRResult {
qr: Base64<ImageType>;
intent: string;
}

export type ImageType='png'|'jpeg'|'webp';export type Base64<imageType extends ImageType>=`data:image/${imageType};base64,${string}`;export interface UPIIntentParams{payeeVPA:string;payeeName:string;payeeMerchantCode?:string;transactionId?:string;transactionRef?:string;transactionNote?:string;amount?:string;minimumAmount?:string;currency?:string;transactionRefUrl?:string;}
export interface QRResult{qr:Base64<ImageType>;intent:string;}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "upiqr",
"version": "1.3.16",
"version": "1.3.17",
"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 All @@ -12,7 +12,8 @@
"package.json"
],
"scripts": {
"build": "tsc"
"minify": "jsmin -o dist/index.d.ts dist/index.d.ts && jsmin -o dist/index.js dist/index.js && jsmin -o dist/types/upiqr.d.ts dist/types/upiqr.d.ts",
"build": "tsc && npm run minify"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -44,6 +45,7 @@
"devDependencies": {
"@types/node": "^20.5.6",
"@types/qrcode": "^1.5.1",
"jsmin": "^1.0.1",
"typescript": "^5.2.2"
}
}

0 comments on commit a9f38f1

Please sign in to comment.