summaryrefslogtreecommitdiff
path: root/src/job.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-12-15 13:05:50 -0800
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-12-15 13:53:43 -0800
commitc0a96e82af651724314114df2d0019ecb83c2830 (patch)
tree9e65dea31c62786cb8970b713a078bab2868be1b /src/job.ts
parent6f45fe5a10174fd33932d17dc056898f06466067 (diff)
downloaduptime-c0a96e82af651724314114df2d0019ecb83c2830.tar.gz
uptime-c0a96e82af651724314114df2d0019ecb83c2830.zip
small refactorings
Diffstat (limited to 'src/job.ts')
-rw-r--r--src/job.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/job.ts b/src/job.ts
index 2beabca..b1198f8 100644
--- a/src/job.ts
+++ b/src/job.ts
@@ -23,3 +23,15 @@ export interface Retry {
retries: number;
interval: number;
}
+
+export const redact = <T extends EmailInstruction>(instruction: T): T => ({
+ ...instruction,
+ password: "REDACTED",
+ username: "REDACTED",
+});
+
+export const redactJob = (job: EmailJob): EmailJob => ({
+ ...job,
+ from: redact(job.from),
+ to: redact(job.to),
+});