Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.usersListConferences(userId, function(conferences) {
var listRequests = [];
_.each(conferences, function(conference) {
listRequests.push(function(subCallback) {
self.usersDeleteConference(conference.id, function(data) {
subCallback(null, data);
});
});
});
monster.parallel(listRequests, function(err, results) {
callback && callback(results);
});
});
},
loadDependencies: function(app, globalCallback) {
var self = this,
listRequests = {},
externalPath = app.appPath + '/external/',
deps = app.externalScripts || [];
if(deps.length > 0) {
_.each(deps, function(name) {
listRequests[name] = function(callback) {
monster.getScript(externalPath + name + '.js', function() {
callback(null, {});
});
}
});
monster.parallel(listRequests, function(err, results) {
globalCallback && globalCallback();
});
}
else {
globalCallback && globalCallback();
}
},
if('pattern' in featureCode) {
callflow.patterns = [ featureCode.pattern ];
}
else {
callflow.numbers = [ featureCode.callflowNumber ];
}
listRequests.push(function(localCallback) {
self.strategyCreateCallflow(callflow, function(data) {
localCallback && localCallback(null, data);
});
});
});
monster.parallel(listRequests, function(err, results) {
callback && callback();
});
}
});
},
_.each(conferences, function(conference) {
listRequests.push(function(subCallback) {
if (forceDelete) {
self.usersDeleteConference(conference.id, function(data) {
subCallback(null, data);
});
} else {
self.usersUnassignConference(conference.id, function(data) {
subCallback(null, data);
});
}
});
});
monster.parallel(listRequests, function(err, results) {
callback && callback(results);
});
},
function(featureCodes, callback) {
monster.parallel(
_.chain(featureCodes)
.filter(function(featureCode) {
return !_.includes(
_.get(featureCode, 'patterns', []),
_.get(expectedFeaturedCodes, [featureCode.featurecode.name, 'pattern'])
) && _.includes(featureCodesToUpdate, featureCode.featurecode.name);
})
.map(function(featureCode) {
return function(parallelCallback) {
self.strategyPatchCallflow({
data: {
callflowId: featureCode.id,
data: {
patterns: [_.get(expectedFeaturedCodes, [featureCode.featurecode.name, 'pattern'])],
numbers: []
}