router.post("/roles/manage-permissions", auth(), function(req, res, next){ async.mapSeries(req.body, function(role, callback) { let roleObj = new Roles({id: role.role_id}); roleObj.setPermissions(role.permission_ids, function (result) { callback(null, result); }); },function(err, result){ if(err){ console.error(err); }else { res.json(result); } }); });
async.mapSeries(parents, function(parent, callback){ parent.attachReferences(function(updatedParent){ callback(null, updatedParent);
router.get(`/${resourceName}/search`, auth(), function (req, res, next) { model.search(req.query.key, req.query.value, function (parents) { if (references === undefined || references.length == 0 || parents.length == 0) { res.locals.json = parents.map(entity => entity.data) next(); } else { async.mapSeries(parents, function(parent, callback){ parent.attachReferences(function(updatedParent){ callback(null, updatedParent); }) },function(err, result){ if(err){ console.error("error attaching references: ", err); } else{ res.locals.json = result.map(entity => entity.data); next(); } }) } }); });
// the validation process can take a lengthy amount of time when processing large responses. // to prevent other requests from being blocked by this syncronous process, we break it up using // setImmediate (see _enforceSchemaOnObject below), and force this map to run in series instead of in parallel. // It really will not make much of a difference to individual requests, but // splitting it up this way makes a HUGE difference if a small request arrives on the server while a large request's // output is still being validated. async.mapSeries(items, (item, done) => responseHelper._enforceSchemaOnObject(item, schema, done), (err, results) => { if (err) return callback(err) results = results.filter(result => !!result) return callback(null, results) })
Async.mapSeries( List, captureFunc, function() {
async.mapSeries(schools, function (school, callback) { School.find({ ST_SCHID: school.ST_SCHID
async.mapSeries(deps, function (d: string, cb: Function) {
async.mapSeries(['hello', 'world'], addThing.bind(null, dbAdapter), function (err, ids) { if (err) return next(err); next(null, ids);
async.mapSeries(files, getMetaData, (err, files) => { if (err) { return done(err);
async.mapSeries(options.steppers, (value, callback) => { stepperlib({ pwm, pins: { W1: pins[value.W1], W2: pins[value.W2] } }).init((err, val) => { if (!err) steppers.push(val); return async.mapSeries(options.dcs, (value, callback) => { dclib({ pwm, pins: pins[value] }).init((err, val) => { if (!err) dcs.push(val);
async.mapSeries(par.sqlBindArray, executeSql, (err, results) => { if(err) { connection.rollback(err2 => {
const defaultMedianIncome = undefined async.mapSeries( zips, function(zip, callback) {