@internetarchive/donation-monthly-portal 7.0.6 → 7.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ export class Receipt {
4
4
  }
5
5
  get amountFormatted() {
6
6
  var _a, _b;
7
- const value = (_a = this.receipt.total_amount) !== null && _a !== void 0 ? _a : this.receipt.net_amount;
7
+ const value = ((_a = this.receipt.total_amount) !== null && _a !== void 0 ? _a : this.receipt.net_amount).toFixed(2);
8
8
  const currencyType = (_b = this.receipt.currency) !== null && _b !== void 0 ? _b : 'CURR not found';
9
9
  if (value) {
10
10
  return `${currencyType} ${this.currencySymbol}${value}`;
@@ -1 +1 @@
1
- {"version":3,"file":"receipt.js","sourceRoot":"","sources":["../../../src/models/receipt.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,OAAO;IAGlB,YAAY,OAAiB;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAI,eAAe;;QACjB,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;QACnE,MAAM,YAAY,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,QAAQ,mCAAI,gBAAgB,CAAC;QAC/D,IAAI,KAAK,EAAE;YACT,OAAO,GAAG,YAAY,IAAI,IAAI,CAAC,cAAc,GAAG,KAAK,EAAE,CAAC;SACzD;QACD,OAAO,wDAAwD,CAAC;IAClE,CAAC;IAED,IAAI,MAAM;;QACR,OAAO,CACL,MAAA,MAAA,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,mCAC9B,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,mCAC5B,wDAAwD,CACzD,CAAC;IACJ,CAAC;IAED,IAAI,MAAM;;QACR,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,MAAM,mCAAI,KAAK,CAAC;IACtC,CAAC;IAED,IAAI,EAAE;;QACJ,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,KAAK,mCAAI,gBAAgB,CAAC;IAChD,CAAC;IAED,IAAI,IAAI;;QACN,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,IAAI,mCAAI,eAAe,CAAC;IAC9C,CAAC;IAED,IAAI,cAAc;QAChB,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE;YACnC,OAAO,GAAG,CAAC;SACZ;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["export type AReceipt = {\n currency: string;\n net_amount: number;\n total_amount: number;\n fee_amount: number;\n receive_date?: Date;\n date: string;\n isTest: boolean;\n token: string;\n id?: string;\n};\nexport class Receipt {\n receipt: AReceipt;\n\n constructor(receipt: AReceipt) {\n this.receipt = receipt;\n }\n\n get amountFormatted(): string {\n const value = this.receipt.total_amount ?? this.receipt.net_amount;\n const currencyType = this.receipt.currency ?? 'CURR not found';\n if (value) {\n return `${currencyType} ${this.currencySymbol}${value}`;\n }\n return \"no amount found, can't find total_amount or net_amount\";\n }\n\n get amount(): string {\n return (\n `${this.receipt.total_amount}` ??\n `${this.receipt.net_amount}` ??\n \"no amount found, can't find total_amount or net_amount\"\n );\n }\n\n get isTest(): boolean {\n return this.receipt.isTest ?? false;\n }\n\n get id(): string {\n return this.receipt.token ?? 'no token found';\n }\n\n get date(): string {\n return this.receipt.date ?? 'no date found';\n }\n\n get currencySymbol(): string {\n if (this.receipt.currency === 'USD') {\n return '$';\n }\n\n return '';\n }\n}\n"]}
1
+ {"version":3,"file":"receipt.js","sourceRoot":"","sources":["../../../src/models/receipt.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,OAAO;IAGlB,YAAY,OAAiB;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAI,eAAe;;QACjB,MAAM,KAAK,GACT,CAAC,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CACtD,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACb,MAAM,YAAY,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,QAAQ,mCAAI,gBAAgB,CAAC;QAC/D,IAAI,KAAK,EAAE;YACT,OAAO,GAAG,YAAY,IAAI,IAAI,CAAC,cAAc,GAAG,KAAK,EAAE,CAAC;SACzD;QACD,OAAO,wDAAwD,CAAC;IAClE,CAAC;IAED,IAAI,MAAM;;QACR,OAAO,CACL,MAAA,MAAA,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,mCAC9B,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,mCAC5B,wDAAwD,CACzD,CAAC;IACJ,CAAC;IAED,IAAI,MAAM;;QACR,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,MAAM,mCAAI,KAAK,CAAC;IACtC,CAAC;IAED,IAAI,EAAE;;QACJ,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,KAAK,mCAAI,gBAAgB,CAAC;IAChD,CAAC;IAED,IAAI,IAAI;;QACN,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,IAAI,mCAAI,eAAe,CAAC;IAC9C,CAAC;IAED,IAAI,cAAc;QAChB,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE;YACnC,OAAO,GAAG,CAAC;SACZ;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["export type AReceipt = {\n currency: string;\n net_amount: number;\n total_amount: number;\n fee_amount: number;\n receive_date?: Date;\n date: string;\n isTest: boolean;\n token: string;\n id?: string;\n};\nexport class Receipt {\n receipt: AReceipt;\n\n constructor(receipt: AReceipt) {\n this.receipt = receipt;\n }\n\n get amountFormatted(): string {\n const value = (\n (this.receipt.total_amount ?? this.receipt.net_amount) as number\n ).toFixed(2);\n const currencyType = this.receipt.currency ?? 'CURR not found';\n if (value) {\n return `${currencyType} ${this.currencySymbol}${value}`;\n }\n return \"no amount found, can't find total_amount or net_amount\";\n }\n\n get amount(): string {\n return (\n `${this.receipt.total_amount}` ??\n `${this.receipt.net_amount}` ??\n \"no amount found, can't find total_amount or net_amount\"\n );\n }\n\n get isTest(): boolean {\n return this.receipt.isTest ?? false;\n }\n\n get id(): string {\n return this.receipt.token ?? 'no token found';\n }\n\n get date(): string {\n return this.receipt.date ?? 'no date found';\n }\n\n get currencySymbol(): string {\n if (this.receipt.currency === 'USD') {\n return '$';\n }\n\n return '';\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/donation-monthly-portal",
3
- "version": "7.0.6",
3
+ "version": "7.0.7",
4
4
  "description": "The Internet Archive Monthly Portal",
5
5
  "license": "AGPL-3.0-only",
6
6
  "main": "dist/index.js",
@@ -17,7 +17,9 @@ export class Receipt {
17
17
  }
18
18
 
19
19
  get amountFormatted(): string {
20
- const value = this.receipt.total_amount ?? this.receipt.net_amount;
20
+ const value = (
21
+ (this.receipt.total_amount ?? this.receipt.net_amount) as number
22
+ ).toFixed(2);
21
23
  const currencyType = this.receipt.currency ?? 'CURR not found';
22
24
  if (value) {
23
25
  return `${currencyType} ${this.currencySymbol}${value}`;