Skip to content

Commit 249adc0

Browse files
refactor: Optimize filterMappings function for backwards compatibility
1 parent 27fde6e commit 249adc0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/integrationCapture.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,12 @@ export default class IntegrationCapture {
222222
private filterMappings(
223223
outputType: valueof<typeof IntegrationOutputs>
224224
): IntegrationIdMapping {
225-
return Object.fromEntries(
226-
Object.entries(integrationMapping).filter(
227-
([, value]) => value.output === outputType
228-
)
229-
);
225+
const filteredMappings: IntegrationIdMapping = {};
226+
for (const key in integrationMapping) {
227+
if (integrationMapping[key].output === outputType) {
228+
filteredMappings[key] = integrationMapping[key];
229+
}
230+
}
231+
return filteredMappings;
230232
}
231233
}

0 commit comments

Comments
 (0)