taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 885b4f9bb6ba53a67048d3ec7ea7d41c6184f5c1
parent 1c3bf5ac1bb0221d33ae41428cbc88a9664c7adb
Author: Florian Dold <florian@dold.me>
Date:   Wed, 23 Apr 2025 12:04:55 +0200

util: improve doc comment and un-deprecate Duration.fromSpec

Diffstat:
Mpackages/taler-util/src/time.ts | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/packages/taler-util/src/time.ts b/packages/taler-util/src/time.ts @@ -281,11 +281,9 @@ export namespace Duration { } /** - * FIXME: it should return undefined when the spec has no values - * @deprecated check fromSpecOrUndefined - * - * @param spec - * @returns + * Construct a duration from a specification of the individual units. + * + * Returns a zero duration if none of the units were specified. */ export function fromSpec(spec: { seconds?: number; @@ -324,7 +322,7 @@ export namespace Duration { return undefined; } - return Duration.fromSpec(spec) + return Duration.fromSpec(spec); } export function toSpec({ d_ms }: Duration):