Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function popFormattingStart(routingKey) {
for (let i = 0; i < pendingFormats.length; i++) {
const pendingFormat = pendingFormats[i];
if (getRoutingKeyPattern(pendingFormat.content.endRoutingKey).test(routingKey)) {
logger.debug(`<${id}> completed formatting ${fields.routingKey} message content with formatter ${routingKey}`);
pendingFormats.splice(i, 1);
pendingFormat.ack();
break;
}
}
}
}