diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-09-12 20:25:56 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-09-12 20:25:56 +0200 |
commit | 885285734733b71c88dfb0da513988eb8678aa14 (patch) | |
tree | dcaa19022de33210a97266fcb7a91055ea8e42c7 /lib/wallet/helpers.ts | |
parent | e3cc9c59bcc36eee8c3234574cfdfda3f5eea658 (diff) | |
download | wallet-core-885285734733b71c88dfb0da513988eb8678aa14.tar.xz |
fix compiler warnings
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), |