From d0ccb5d6183cf4b7188258cdb605c727b499d284 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sat, 21 Jun 2025 23:00:56 +0800 Subject: mail: organize utils in namespace-like object. no logging cause. --- deno/mail-relay/aws/fetch.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'deno/mail-relay/aws/fetch.ts') diff --git a/deno/mail-relay/aws/fetch.ts b/deno/mail-relay/aws/fetch.ts index da8609f..34948d4 100644 --- a/deno/mail-relay/aws/fetch.ts +++ b/deno/mail-relay/aws/fetch.ts @@ -8,7 +8,7 @@ import { S3ClientConfig, } from "@aws-sdk/client-s3"; -import { toFileNameString } from "@crupest/base"; +import { DateUtils } from "@crupest/base"; import { Mail } from "../mail.ts"; @@ -98,7 +98,9 @@ export class AwsMailFetcher { rawMail = await res.Body.transformToString(); } catch (cause) { if (cause instanceof NoSuchBucket) { - console.error(`S3 mail key ${s3Key} not found. Perhaps already consumed?`) + console.error( + `S3 mail key ${s3Key} not found. Perhaps already consumed?`, + ); return; } throw cause; @@ -109,7 +111,7 @@ export class AwsMailFetcher { const { date } = new Mail(rawMail).parsed; const dateString = date != null - ? toFileNameString(date, true) + ? DateUtils.toFileNameString(date, true) : "invalid-date"; const newPath = `${this.#archivePrefix}${dateString}/${s3Key}`; -- cgit v1.2.3