From 37213aec65b766ef45b86b20e9df6ca50e9b929d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 29 Mar 2023 23:53:07 -0500 Subject: [PATCH] antiDuplicationPolicy refactor opts --- src/policies/anti-duplication-policy.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/policies/anti-duplication-policy.ts b/src/policies/anti-duplication-policy.ts index bc984bf..f1fb57e 100755 --- a/src/policies/anti-duplication-policy.ts +++ b/src/policies/anti-duplication-policy.ts @@ -17,9 +17,11 @@ interface AntiDuplication { * Only messages that meet the minimum length criteria are selected. */ const antiDuplicationPolicy: Policy = async (msg, opts = {}) => { - const ttl = opts.ttl ?? 60000; - const minLength = opts.minLength ?? 50; - const databaseUrl = opts.databaseUrl ?? 'sqlite:///tmp/strfry-anti-duplication-policy.sqlite3'; + const { + ttl = 60000, + minLength = 50, + databaseUrl = 'sqlite:///tmp/strfry-anti-duplication-policy.sqlite3', + } = opts; const { kind, content } = msg.event;