Skip to content

Commit 1c4a0cb

Browse files
committed
chore: simplified throwOnNoIdempotencyKey conditional assignment
1 parent aa31f7a commit 1c4a0cb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: packages/idempotency/src/persistence/BasePersistenceLayer.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ abstract class BasePersistenceLayer implements BasePersistenceLayerInterface {
5151
this.eventKeyJmesPath = idempotencyConfig?.eventKeyJmesPath;
5252
this.validationKeyJmesPath = idempotencyConfig?.payloadValidationJmesPath;
5353
this.payloadValidationEnabled = this.validationKeyJmesPath !== undefined || false;
54-
if (idempotencyConfig?.throwOnNoIdempotencyKey)
55-
this.throwOnNoIdempotencyKey = idempotencyConfig.throwOnNoIdempotencyKey;
54+
this.throwOnNoIdempotencyKey = idempotencyConfig?.throwOnNoIdempotencyKey || false;
5655
this.eventKeyJmesPath = idempotencyConfig.eventKeyJmesPath;
5756
this.expiresAfterSeconds = idempotencyConfig.expiresAfterSeconds; // 1 hour default
5857
// TODO: Add support for local cache

0 commit comments

Comments
 (0)