Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for (i in JSONData.players) {
// console.log(i);
if (JSONData.players[i].id == strikebatid) {
console.log(clc.yellowBright(JSONData.players[i].f_name) + clc.cyanBright(" R: ") + clc.yellowBright(this.score.batsman[0].r) + clc.cyanBright(" B: ") + clc.yellowBright(this.score.batsman[0].b) + clc.cyanBright(" 4s: ") + clc.yellowBright(this.score.batsman[0]['4s']) + clc.cyanBright(" 6s: ") + clc.yellowBright(this.score.batsman[0]['6s']))
}
}
}
if (this.score.batsman[1] && this.score.batsman[1].strike == "0") {
var nonstrikebatid = this.score.batsman[1].id
for (i in JSONData.players) {
if (JSONData.players[i].id == nonstrikebatid) {
console.log(clc.yellowBright(JSONData.players[i].f_name) + clc.cyanBright(" R: ") + clc.yellowBright(this.score.batsman[1].r) + clc.cyanBright(" B: ") + clc.yellowBright(this.score.batsman[1].b) + clc.cyanBright(" 4s: ") + clc.yellowBright(this.score.batsman[1]['4s']) + clc.cyanBright(" 6s: ") + clc.yellowBright(this.score.batsman[1]['6s']))
}
}
}
// Bowling Stats
if (this.score.bowler) {
console.log("---------- Bowling Stats ----------");
}
// Current bowler
if (this.score.bowler[0]) {
var strikebowlid = this.score.bowler[0].id;
for (i in JSONData.players) {
if (JSONData.players[i].id == strikebowlid) {
console.log(clc.yellowBright(JSONData.players[i].f_name + "* ") + clc.cyanBright(" O: ") + clc.yellowBright(this.score.bowler[0].o) + clc.cyanBright(" M: ") + clc.yellowBright(this.score.bowler[0].m) + clc.cyanBright(" R: ") + clc.yellowBright(this.score.bowler[0].r) + clc.cyanBright(" W: ") + clc.yellowBright(this.score.bowler[0].w))
function makeModuleDatabaseTableWithReset(moduleName) {
console.log(` = Reset database tables for ${clc.yellowBright(moduleName)} module`);
const connectionInfo = require(path.join('..', configFile))['database'];
const module = require('../module/' + moduleName + '/lib/database');
// delete scheme before create table
module.deleteScheme(connectionInfo, module.createScheme);
}
function testapp(target, opts, next) {
logger.log(clc.yellowBright('Launching Test App:'), target);
common.track("BasilTestApp", {"target":target});
if (targetNames.indexOf(target) >= 0) {
require(targetPaths[target]).testapp(common, opts, next);
} else {
next(1);
}
}
sayThanks() {
const warningKeys = Object.keys(global.Warnings);
if (warningKeys.length > 0) {
var warningMessage = "";
var warningCount = 0;
warningKeys.forEach(key => {
warningMessage += clc.whiteBright(`\n${key}:\n`);
global.Warnings[key].forEach(line => {
warningMessage += `\n${line}`;
warningCount++;
});
});
console.log(clc.yellowBright(`\nWarning!!! Compiled with ${clc.white(warningCount)} issues`));
console.log(`${warningMessage}\n`);
}
else
console.log(clc.greenBright("\nSuccess...\n"));
console.log(`Thanks for use ${clc.whiteBright("Rocket Translator")}.\n\nOpen ${clc.whiteBright(this.output)} to view your files.`);
console.log(`\nSend a feedback to ${clc.whiteBright("@davidsdevel")} on Twitter.\n\nTo report a Error, open a new issue on:\n${clc.whiteBright("https://github.com/davidsdevel/rocket-translator")}`);
}
}
start: function(options, callback) {
options.verbose = (options.verbose == undefined) ? true : options.verbose;
options.__tick = new exectimer.Tick("TIMER");
if (options.verbose) {
console.log(clc.yellowBright('\n tasks.helpers.tick.start'));
}
options.__tick.start()
callback(null, options)
},
end: function(options, callback) {
parse: function(options, callback) {
console.log(clc.yellowBright('\n tasks.helpers.csv.parse'));
if(!options.source) {
return callback(' Please specify the file path with --source=path/to/source.tsv');
}
csv.parse(''+fs.readFileSync(options.source), {
columns : true,
delimiter: options.delimiter || '\t'
}, function (err, data) {
if(err) {
callback(err);
return;
}
console.log(clc.blackBright(' parsing csv file completed,', clc.magentaBright(data.length), 'records found'));
console.log(clc.blackBright(' e.g:'), _.take(data,2));
options.data = data;
callback(null, options);
});
function listColumns(table) {
if (columns[table]) {
console.log('\n' + clc.yellowBright('Column listing for ') + clc.greenBright(table) + ':');
u.each(columns[table], function(col, idx) {
console.log(clc.greenBright(idx) + ': ' + clc.greenBright(col));
});
}
}
var q = async.queue(function (record, nextRecord) {
console.log(clc.yellowBright(record.name))
helpers.dbpediaPerson(record.links_wiki, function (err, wiki) {
if(err)
return nextRecord()
record.wiki_first_name = wiki.first_name
record.wiki_last_name = wiki.last_name
record.wiki_birth_date = wiki.birth_date
record.wiki_death_date = wiki.death_date;
setTimeout(function(){
nextRecord()
}, 500);
})
}, 1)
q.push(records)
exports.log = function (app, config, cb) {
console.log();
logger.log(color.blueBright("Prebuild phase completed for", app.manifest.title || app.manifest.shortName));
logger.log("\tbuild for:", color.yellowBright(config.target), "\t\tscheme:", config.scheme);
console.log();
console.log(color.white(" --- start config ---"));
for (var key in config) {
if (key == 'argv') { continue; }
var value = config[key];
var strValue;
if (typeof value == 'object') {
console.log(color.yellowBright(printf('%25s', key + ':')));
for (var key in value) {
strValue = typeof value[key] == 'object' ? JSON.stringify(value[key]) : '' + value[key];
console.log(color.yellow(printf('%29s', key + ':')), truncate(strValue));
}
} else {
m.any = function(f) {
var errMsg1b = clc.magenta(" method: ") + clc.yellowBright("any");
var errMsg2b = clc.magenta(" method:") + clc.yellowBright("any") + clc.magenta(" there is non-function & non-string element:");
myUtil.checkErr(!(myUtil.isFunction(f) || myUtil.isArray(f) || myUtil.isString(f)),
errMsg1a + clc.yellowBright(path) + errMsg1b);
if (myUtil.isFunction(f) || myUtil.isString(f))
f = [f];
for (var ki = 0; ki < f.length; ki++)
myUtil.checkErr(!(myUtil.isFunction(f[ki]) || myUtil.isString(f[ki])),
errMsg2a + clc.yellowBright(path) + errMsg2b + clc.yellowBright(JSON.stringify(f[ki])));
this.save.router.any.any = f;
return this;
};