From faba5e9db8e0d1fdc4845de6b504b4e2ea3ca72b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 7 Apr 2020 13:58:55 +0530 Subject: finally make linter happy --- src/util/codec-test.ts | 2 +- src/util/query.ts | 6 +++++- src/util/taleruri.ts | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src/util') diff --git a/src/util/codec-test.ts b/src/util/codec-test.ts index e25a9d3cd..b429c318c 100644 --- a/src/util/codec-test.ts +++ b/src/util/codec-test.ts @@ -51,7 +51,7 @@ test("basic codec", (t) => { t.assert(res.foo === "hello"); t.throws(() => { - const res2 = myObjCodec.decode({ foo: 123 }); + myObjCodec.decode({ foo: 123 }); }); }); diff --git a/src/util/query.ts b/src/util/query.ts index 8dd3ff1e2..401d22e71 100644 --- a/src/util/query.ts +++ b/src/util/query.ts @@ -431,7 +431,11 @@ export function openDatabase( }; req.onupgradeneeded = (e) => { const db = req.result; - onUpgradeNeeded(db, e.oldVersion, e.newVersion!); + const newVersion = e.newVersion; + if (!newVersion) { + throw Error("upgrade needed, but new version unknown"); + } + onUpgradeNeeded(db, e.oldVersion, newVersion); console.log( `DB: upgrade needed: oldVersion=${e.oldVersion}, newVersion=${e.newVersion}`, ); diff --git a/src/util/taleruri.ts b/src/util/taleruri.ts index 46cc199f8..2eaea2846 100644 --- a/src/util/taleruri.ts +++ b/src/util/taleruri.ts @@ -97,7 +97,10 @@ export function classifyTalerUri(s: string): TalerUriType { return TalerUriType.Unknown; } -export function getOrderDownloadUrl(merchantBaseUrl: string, orderId: string): string { +export function getOrderDownloadUrl( + merchantBaseUrl: string, + orderId: string, +): string { const u = new URL("proposal", merchantBaseUrl); u.searchParams.set("order_id", orderId); return u.href; -- cgit v1.2.3