taler-typescript-core

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

commit 093dd8f7cb83a2d0b4baae56adbb1c4c35cf46f6
parent e4f13e6619a387098abeed5960e4b73d2c012487
Author: Florian Dold <florian@dold.me>
Date:   Sat, 18 Jul 2026 11:45:48 +0200

util: remove buggy and unused helper function

Diffstat:
Mpackages/taler-util/src/http-common.ts | 25+------------------------
1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/packages/taler-util/src/http-common.ts b/packages/taler-util/src/http-common.ts @@ -22,7 +22,7 @@ import { makeErrorDetail, TalerError } from "./errors.js"; import { j2s } from "./helpers.js"; import { Logger } from "./logging.js"; import { TalerErrorCode } from "./taler-error-codes.js"; -import { AbsoluteTime, Duration } from "./time.js"; +import { Duration } from "./time.js"; import { TalerErrorDetail } from "./types-taler-wallet.js"; const textEncoder = new TextEncoder(); @@ -470,29 +470,6 @@ export async function readSuccessResponseTextOrThrow<T>( throwUnexpectedRequestError(httpResponse, r.talerErrorResponse); } -/** - * Get the timestamp at which the response's content is considered expired. - */ -export function getExpiry( - httpResponse: HttpResponse, - opt: { minDuration?: Duration }, -): AbsoluteTime { - const expiryDateMs = new Date( - httpResponse.headers.get("expiry") ?? "", - ).getTime(); - let t: AbsoluteTime; - if (Number.isNaN(expiryDateMs)) { - t = AbsoluteTime.now(); - } else { - t = AbsoluteTime.fromMilliseconds(expiryDateMs); - } - if (opt.minDuration) { - const t2 = AbsoluteTime.addDuration(AbsoluteTime.now(), opt.minDuration); - return AbsoluteTime.max(t, t2); - } - return t; -} - export interface HttpLibArgs { enableThrottling?: boolean; /**