[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] 02/02: currency name up to 11 fractions up to 8
From: |
gnunet |
Subject: |
[taler-wallet-core] 02/02: currency name up to 11 fractions up to 8 |
Date: |
Wed, 04 Oct 2023 18:41:54 +0200 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
commit 535b990215bdd861df5cf6215a5f72a47576f89b
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Wed Oct 4 13:41:40 2023 -0300
currency name up to 11 fractions up to 8
---
packages/taler-util/src/amounts.ts | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/packages/taler-util/src/amounts.ts
b/packages/taler-util/src/amounts.ts
index a8df3679f..04343b8e9 100644
--- a/packages/taler-util/src/amounts.ts
+++ b/packages/taler-util/src/amounts.ts
@@ -345,9 +345,12 @@ export class Amounts {
/**
* Parse an amount like 'EUR:20.5' for 20 Euros and 50 ct.
+ *
+ * Currency name size limit is 11 of ASCII letters
+ * Fraction size limit is 8
*/
static parse(s: string): AmountJson | undefined {
- const res = s.match(/^([a-zA-Z0-9_*-]+):([0-9]+)([.][0-9]+)?$/);
+ const res = s.match(/^([a-zA-Z]{1,11}):([0-9]+)([.][0-9]{1,8})?$/);
if (!res) {
return undefined;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.