Skip to content

Commit

Permalink
refactor: Optimize filterMappings function for backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
alexs-mparticle committed Jan 29, 2025
1 parent 27fde6e commit 249adc0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/integrationCapture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,12 @@ export default class IntegrationCapture {
private filterMappings(
outputType: valueof<typeof IntegrationOutputs>
): IntegrationIdMapping {
return Object.fromEntries(
Object.entries(integrationMapping).filter(
([, value]) => value.output === outputType
)
);
const filteredMappings: IntegrationIdMapping = {};
for (const key in integrationMapping) {
if (integrationMapping[key].output === outputType) {
filteredMappings[key] = integrationMapping[key];
}
}
return filteredMappings;
}
}

0 comments on commit 249adc0

Please sign in to comment.