From 3c57820df0711f301e69adb0f4b8a91f0905cc0c Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 4 Sep 2020 12:04:11 +0530 Subject: formatting, import --- packages/taler-wallet-core/src/util/codec.ts | 4 ++-- packages/taler-wallet-core/src/util/http.ts | 9 ++++++++- packages/taler-wallet-core/src/util/time.ts | 16 ++++++++-------- 3 files changed, 18 insertions(+), 11 deletions(-) (limited to 'packages/taler-wallet-core/src/util') diff --git a/packages/taler-wallet-core/src/util/codec.ts b/packages/taler-wallet-core/src/util/codec.ts index 741a5b172..4654c8b93 100644 --- a/packages/taler-wallet-core/src/util/codec.ts +++ b/packages/taler-wallet-core/src/util/codec.ts @@ -302,8 +302,8 @@ export function codecForBoolean(): Codec { `expected boolean at ${renderContext(c)} but got ${typeof x}`, ); }, - } -}; + }; +} /** * Return a codec for a value that must be a string. diff --git a/packages/taler-wallet-core/src/util/http.ts b/packages/taler-wallet-core/src/util/http.ts index e050efe61..1a2459f7e 100644 --- a/packages/taler-wallet-core/src/util/http.ts +++ b/packages/taler-wallet-core/src/util/http.ts @@ -26,7 +26,14 @@ import { Codec } from "./codec"; import { OperationFailedError, makeErrorDetails } from "../operations/errors"; import { TalerErrorCode } from "../TalerErrorCode"; import { Logger } from "./logging"; -import { Duration, Timestamp, getTimestampNow, timestampAddDuration, timestampMin, timestampMax } from "./time"; +import { + Duration, + Timestamp, + getTimestampNow, + timestampAddDuration, + timestampMin, + timestampMax, +} from "./time"; const logger = new Logger("http.ts"); diff --git a/packages/taler-wallet-core/src/util/time.ts b/packages/taler-wallet-core/src/util/time.ts index 1f085107f..5a5e9c608 100644 --- a/packages/taler-wallet-core/src/util/time.ts +++ b/packages/taler-wallet-core/src/util/time.ts @@ -86,7 +86,7 @@ export function timestampMax(t1: Timestamp, t2: Timestamp): Timestamp { return { t_ms: Math.max(t1.t_ms, t2.t_ms) }; } -const SECONDS = 1000 +const SECONDS = 1000; const MINUTES = SECONDS * 60; const HOURS = MINUTES * 60; const DAYS = HOURS * 24; @@ -94,12 +94,12 @@ const MONTHS = DAYS * 30; const YEARS = DAYS * 365; export function durationFromSpec(spec: { - seconds?: number, - minutes?: number, - hours?: number, - days?: number, - months?: number, - years?: number, + seconds?: number; + minutes?: number; + hours?: number; + days?: number; + months?: number; + years?: number; }): Duration { let d_ms = 0; d_ms += (spec.seconds ?? 0) * SECONDS; @@ -148,7 +148,7 @@ export function durationMul(d: Duration, n: number): Duration { if (d.d_ms === "forever") { return { d_ms: "forever" }; } - return { d_ms: Math.round( d.d_ms * n) }; + return { d_ms: Math.round(d.d_ms * n) }; } export function timestampCmp(t1: Timestamp, t2: Timestamp): number { -- cgit v1.2.3