commit dbff2c5670c1a18eec618b693786081011cf3ff3
parent 4ed6e818da414ad64835ffa7f233248b6c6c65c5
Author: Florian Dold <florian@dold.me>
Date: Wed, 15 Jul 2026 15:09:19 +0200
util: compare currencies case-insensitively
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/taler-util/src/amounts.ts b/packages/taler-util/src/amounts.ts
@@ -392,7 +392,7 @@ export class Amounts {
static cmp(a: AmountLike, b: AmountLike): -1 | 0 | 1 {
a = Amounts.jsonifyAmount(a);
b = Amounts.jsonifyAmount(b);
- if (a.currency !== b.currency) {
+ if (a.currency.toUpperCase() !== b.currency.toUpperCase()) {
throw Error(`Mismatched currency: ${a.currency} and ${b.currency}`);
}
const av = a.value + Math.floor(a.fraction / amountFractionalBase);