diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-09-22 15:09:18 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-09-22 15:09:18 +0200 |
commit | 4974dd19c02778f0c58fad6cd12e839c9164e00d (patch) | |
tree | 69198fc1d53cb595ed1cb393e86ac7ef0038a309 /lib/wallet/helpers.ts | |
parent | 903bb780dea2a4c538d2ffde3ba5a0a7f4497050 (diff) | |
parent | fca125a0da491e1753d2902d21a672559936922b (diff) |
Merge branch 'master' of git+ssh://taler.net/var/git/wallet-webex
Diffstat (limited to 'lib/wallet/helpers.ts')
-rw-r--r-- | lib/wallet/helpers.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/wallet/helpers.ts b/lib/wallet/helpers.ts index fd1650758..5d231fe64 100644 --- a/lib/wallet/helpers.ts +++ b/lib/wallet/helpers.ts @@ -24,7 +24,7 @@ import {AmountJson} from "./types"; -export function substituteFulfillmentUrl(url: string, vars) { +export function substituteFulfillmentUrl(url: string, vars: any) { url = url.replace("${H_contract}", vars.H_contract); url = url.replace("${$}", "$"); return url; @@ -42,7 +42,7 @@ export function amountToPretty(amount: AmountJson): string { * * See http://api.taler.net/wallet.html#general */ -export function canonicalizeBaseUrl(url) { +export function canonicalizeBaseUrl(url: string) { let x = new URI(url); if (!x.protocol()) { x.protocol("https"); @@ -54,10 +54,10 @@ export function canonicalizeBaseUrl(url) { } -export function parsePrettyAmount(pretty: string): AmountJson { +export function parsePrettyAmount(pretty: string): AmountJson|undefined { const res = /([0-9]+)(.[0-9]+)?\s*(\w+)/.exec(pretty); if (!res) { - return null; + return undefined; } return { value: parseInt(res[1], 10), |