summaryrefslogtreecommitdiff
path: root/src/job.ts
diff options
context:
space:
mode:
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),
+});