Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
references.forEach(({serviceName, version, ...reference}) => {
let service = _.find(manifest.services, {serviceName});
if (!service) {
service = {serviceName};
manifest.services.push(service);
}
// distinguish references for exchanges and APIs by presence of exchangePrefix
if (reference.exchangePrefix) {
_.defaults(service, {pulse: []});
service.pulse.push({version, reference: libUrls.exchangeReference('', serviceName, version)});
} else {
_.defaults(service, {apis: []});
service.apis.push({version, reference: libUrls.apiReference('', serviceName, version)});
}
});