aboutsummaryrefslogtreecommitdiff
path: root/lib/wallet/helpers.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-09-12 20:25:56 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-09-12 20:25:56 +0200
commit885285734733b71c88dfb0da513988eb8678aa14 (patch)
treedcaa19022de33210a97266fcb7a91055ea8e42c7 /lib/wallet/helpers.ts
parente3cc9c59bcc36eee8c3234574cfdfda3f5eea658 (diff)
downloadwallet-core-885285734733b71c88dfb0da513988eb8678aa14.tar.xz
fix compiler warnings
Diffstat (limited to 'lib/wallet/helpers.ts')
-rw-r--r--lib/wallet/helpers.ts8
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),