From caef795896402696b7eca6295c5cfccd1a504d82 Mon Sep 17 00:00:00 2001 From: Louis Bompart Date: Mon, 18 Mar 2024 10:27:23 -0400 Subject: [PATCH] fix: resource type predicate (#1454) ## Proposed changes #1453 , I didn't test the suggestion, and it was breaking the code. Iterating from the OG code + suggestions, here's a nice solution. ## Testing: - Reproduced reported issue w/ master and latest release - Did not with this change --- packages/cli/core/src/lib/snapshot/snapshotReporter.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/cli/core/src/lib/snapshot/snapshotReporter.ts b/packages/cli/core/src/lib/snapshot/snapshotReporter.ts index 05b33b7203..7a01557a39 100644 --- a/packages/cli/core/src/lib/snapshot/snapshotReporter.ts +++ b/packages/cli/core/src/lib/snapshot/snapshotReporter.ts @@ -70,11 +70,7 @@ export class SnapshotReporter { public getAffectedResourceTypes(): ResourceSnapshotType[] { const isResourceTypeReportAffected = ( report: ResourceSnapshotsReportOperationModel - ) => - Object.values(report).reduce( - (operation, total) => operation + total, - 0 - ) === 0; + ) => Object.values(report).some((operation) => operation > 0); const changedResourcesTypes: ResourceSnapshotType[] = []; for (const resourceType of Object.keys(this.report.resourceOperations)) { if (