Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function suggestShell(projectName) {
console.log(`${chalk.yellow('cd')} ${projectName}`);
console.log(`${chalk.yellow('npm start')}`);
}
.then(function() {
var parentModulePath = self.cli.reflect.findParentModule(dest);
self.cli.refactor.addModuleImport({
identifier: Case.camel(moduleName),
child: path.resolve(dest + '/' + Case.kebab(moduleName) +'.module.js'),
parent: parentModulePath
});
self.cli.refactor.addAngularDependency({
identifier: Case.kebab(moduleName),
module: parentModulePath
});
console.log(chalk.yellow('\nPlease carefully examine all changes before you commit!\n'));
});
const createEventLogger = (label, name) => (event, data = {}) => {
log.info(chalk.yellow(label, name));
Object.entries(data).forEach(([key, value]) => {
console.log(` ${key}: ${JSON.stringify(value)}`);
});
};
return (word, data) => {
console.log(`\n ${heading.replace('WORD', chalk.yellow(word))}\n`)
logList(data[propName])
}
}
}
}
if (config.settings.raw) {
var doc = tiapp.doc;
var select = xpath.useNamespaces({
"ti": "http://ti.appcelerator.org",
"android": "http://schemas.android.com/apk/res/android"
});
for (var path in config.settings.raw) {
if (!config.settings.raw.hasOwnProperty(path)) continue;
var node = select(path, doc, true);
if (!node) {
console.log(chalk.yellow('Could not find ' + path + ", skipping"));
continue;
}
var replaceWith = config.settings.raw[path]
.replace('$DATE$', new Date().toLocaleDateString())
.replace('$TIME$', new Date().toLocaleTimeString())
.replace('$DATETIME$', new Date().toLocaleString())
.replace('$TIME_EPOCH$', new Date().getTime().toString());
var matches = regex.exec(replaceWith);
if (matches && matches[1]) {
var propName = matches[1];
replaceWith = replaceWith.replace(regex, tiapp[propName]);
}
exports.generateContextHelp = function(cmdContext, allCommands) {
console.log(chalk.yellow.underline('\nActions for the \'%s\' context:'), cmdContext);
console.log(chalk.dim('Note: pass "--help" after any for contextual help\n'));
for (let cmdAction in allCommands[cmdContext]) {
let dots = _.repeat('.', 15 - cmdAction.length);
let actionConfig = allCommands[cmdContext][cmdAction];
console.log('%s %s %s', chalk.yellow(cmdAction), chalk.dim(dots), actionConfig.description);
}
console.log('');
return Promise.resolve();
};
approveAugurEternalApprovalValue(augur, auth.address, auth, function(err) {
if (err) {
console.log(chalk.red("Error "), chalk.red(err));
return callback(err);
}
var market = marketInfos[0];
var marketId = market.id;
console.log(chalk.yellow.dim("user"), chalk.yellow(auth.address));
console.log(
chalk.yellow.dim("outcome:"),
chalk.yellow(outcome),
chalk.yellow.dim("order type:"),
chalk.yellow(orderType)
);
console.log(
chalk.green.dim("price:"),
chalk.green(price),
chalk.green.dim("Shares"),
chalk.green(amount),
chalk.green("Use Shares"),
chalk.green(useShares ? true : false)
);
augur.trading.placeNativeTrade({
meta: auth,
amount: amount,
limitPrice: price,
client.createSession(function (err, session) {
if (err) {
log(chalk.red("Error : "), err);
} else {
the_session = session;
log("session created ", session.sessionId.toString());
proxyManager = new UAProxyManager(the_session);
the_prompt = chalk.cyan("session:") + chalk.yellow(the_session.sessionId.toString()) + chalk.cyan(">");
rl.setPrompt(the_prompt);
assert(!crawler);
rl.prompt(the_prompt);
}
callback();
});
client.on("close", function () {
post += ` ${chalk.red('[RUNTIME ERROR]')}`;
} else if (node.completions.indexOf('unknown') !== -1) {
post += ` ${chalk.cyan('[INCOMPLETE]')}`;
} else if (node.completions.indexOf('throw') !== -1) {
post += ` ${chalk.magenta('throws')}`;
}
}
if (node.file && file !== node.file) {
post += chalk.gray(` (${node.file})`);
}
if (node.apis) {
const symbol = symbols[node.type] || '•';
return `${pre}${chalk.green(`${symbol} ${node.name}`)}${post}`;
}
if (node.type === 'event') {
return `${pre}${chalk.yellow(node.name)}${post}`;
}
return `${pre}${node.name}${post}`;
}
return () => {
eventListener.removeListener(resolve)
reject(
Error(`Sender didn't send payment channel opening request for channel ${chalk.yellow(channelId.toString('hex'))} in time.`)
)
}
})(),