router.get("/roles/manage-permissions", auth(), function(req, res, next){ Roles.findAll(true, true, function(result){ async.map(result, function(role, callback){ role.getPermissions(function(permissions){ callback(null, {role_id: role.get("id"), permission_ids: permissions.map(perm => perm.get("id"))}); }) }, function(e, r){ if(e){ res.locals.json = {error: e}; return next(); } res.locals.json = r; next(); }) }) });
async.map(files, function (directory, callback) { fs.readFile(path.join(__dirname, '../public/themes/' + directory + '/package.json'), function (err, file) { if (err) return callback(err);
}, function (columns, callback) { async.map(columns, function (column, callback) { contents.find({ category: column._id, status: 'pushed', deleted: false, date: { $lte: new Date() } }) .sort('-date') if (err) return callback(err); column.contents = _.map(contents, function (content) { if (content.thumbnail) var thumbnailSrc = content.thumbnail.src;
category.node = _.map(_.sortBy(source[0], 'sort'), '_id'); }, function (categories, callback) { async.map(categories, function (category, callback) { if (category.node) { contents.find({ category: { $in: category.node }, status: 'pushed', deleted: false }) if (err) return callback(err); category.contents = _.map(contents, function (content) { if (content.thumbnail) var thumbnailSrc = content.thumbnail.src; if (err) return callback(err); category.contents = _.map(contents, function (content) { if (content.thumbnail) var thumbnailSrc = content.thumbnail.src;
function V(a = x) { let b = u(`concat files`); m.map(M.concat, (a, b) => { console.log(`concatenating file ${a.name} `), m.parallel(a.from.map((a) => (b) => p(a, b)), (c, d) => c ? ( r(`read source file for concatenating failed!`), b(c)) : ( q(a.to, d.join('\n')), b())); }, (c) => c ? (b.fail(c), a(c)) : (b.done(), a())); }
function ba(a) { if (aa) throw `buildScripts could be only called one time!`; aa = !0; let b = u('handler scripts'), { src: c, dist: d } = M, e = o(M.src_script_globs, { cwd: c }); m.map(e, (a, b) => ca(h(c, a), h(d, ia(a)), b), () => (b.done(), a && a())); }
async.map(process.argv.slice(2,5),getAsync, (error, results) =>{ if(error) console.error('Error: '+error); printResults(results); });
function ubiquityTest( done ) { this.timeout( 6000 ); var platform = NodeWebcam.Factory.Platform; var types = CamTypes[ platform ]; var url = __dirname + "/output/test_image"; Async.map( types, captureFromCam, done ); function captureFromCam( type, callback ) { var Webcam = new NodeWebcam[ type ]; Webcam.capture( url, function() { callback(); }); } }
async.map(items, (item, done) => responseHelper._enforceSchemaOnObject(item, schema, done), (err, results) => { if (err) return callback(err) results = results.filter(result => !!result) return callback(null, results) })
function inspectAndDescribeFiles(folderPath, files, cb) { async.map(files, (file, asyncCb) => { let resolvedFilePath = path.resolve(folderPath, file); inspectAndDescribeFile(resolvedFilePath, asyncCb); }, cb); }
_processLogEntries(params, done) { return async.map( this.logReaders, (logReader, cb) => logReader.processLogEntries(params, cb), done); }
function fa(a) { let b = u('handler styles'), { src: c, dist: d } = M, e = o(M.src_styles_globs, { cwd: c }); m.map(e, (a, b) => ga(h(c, a), h(d, ia(a)), b), () => (b.done(), a && a())); }