本文整理汇总了TypeScript中chalk.bold类的典型用法代码示例。如果您正苦于以下问题:TypeScript bold类的具体用法?TypeScript bold怎么用?TypeScript bold使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了bold类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: debug
tailer.on('exit', (result, details) => {
debug('python tailer exited');
if (result === 'error') {
debug('Installer: Tailer found error with installer', details);
reject(new Error(`Found error with Python installer: ${details}`));
}
if (result === 'success') {
pythonLastLines = [ chalk.bold.green('Successfully installed Python 2.7') ];
debug('Installer: Successfully installed Python 2.7 according to tailer');
resolve({
installPath: details || getPythonInstallerPath().targetPath,
toConfigure: true,
success: true
});
}
if (result === 'failure') {
log(chalk.bold.red('\nCould not install Python 2.7.'));
log('Please find more details in the log files, which can be found at');
log(getWorkDirectory() + '\n');
debug('Installer: Failed to install Python 2.7 according to tailer');
resolve({
success: false
});
}
});
示例2: _drawUIDoneWithSkipped
private _drawUIDoneWithSkipped() {
this._pipe.write(CLEAR);
const numPass = this._countPaths - this._testAssertions.length;
let stats = chalk.bold.dim(
pluralize('snapshot', this._countPaths) + ' reviewed',
);
if (numPass) {
stats +=
', ' + chalk.bold.green(pluralize('snapshot', numPass) + ' updated');
}
if (this._skippedNum) {
stats +=
', ' +
chalk.bold.yellow(pluralize('snapshot', this._skippedNum) + ' skipped');
}
const messages = [
'\n' + chalk.bold('Interactive Snapshot Result'),
ARROW + stats,
'\n' + chalk.bold('Watch Usage'),
chalk.dim(ARROW + 'Press ') +
'r' +
chalk.dim(' to restart Interactive Snapshot Mode.'),
chalk.dim(ARROW + 'Press ') +
'q' +
chalk.dim(' to quit Interactive Snapshot Mode.'),
];
this._pipe.write(messages.filter(Boolean).join('\n') + '\n');
}
示例3: enhanceUnexpectedTokenMessage
export default function enhanceUnexpectedTokenMessage(e: Error) {
e.stack =
`${chalk.bold.red('Jest encountered an unexpected token')}
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Here's what you can do:
${DOT}To have some of your "node_modules" files transformed, you can specify a custom ${chalk.bold(
'"transformIgnorePatterns"',
)} in your config.
${DOT}If you need a custom transformation specify a ${chalk.bold(
'"transform"',
)} option in your config.
${DOT}If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the ${chalk.bold(
'"moduleNameMapper"',
)} config option.
You'll find more details and examples of these config options in the docs:
${chalk.cyan('https://jestjs.io/docs/en/configuration.html')}
${chalk.bold.red('Details:')}
` + e.stack;
return e;
}
示例4: switch
diffResult.diffSet.forEach(function(entry) {
switch (entry.state) {
case 'equal':
return;
case 'left':
const expectedFileRelPath =
path.join(entry.relativePath || '/', entry.name1);
errorOutputLines.push((chalk.bold.green(' + ' + expectedFileRelPath)));
return;
case 'right':
const actualFileRelPath =
path.join(entry.relativePath || '/', entry.name2);
errorOutputLines.push((chalk.bold.red(' - ' + actualFileRelPath)));
return;
case 'distinct':
const diffedFileRelPath =
path.join(entry.relativePath || '/', entry.name1);
const expectedFilePath = path.join(entry.path1, entry.name1);
const actualFilePath = path.join(entry.path2, entry.name2);
const patch = diff.createPatch(
'string',
fs.readFileSync(expectedFilePath, 'utf8'),
fs.readFileSync(actualFilePath, 'utf8'),
'expected',
'converted');
errorOutputLines.push((chalk.bold.red('<> ' + diffedFileRelPath)));
errorOutputLines.push(formatDiffPatch(patch));
return;
default:
throw new Error('Unexpected diff-entry format: ' + entry);
}
});
示例5: output
function output(msg: string, severity: string) {
if (severity === "warning") {
console.warn(chalk.bold.yellow(msg));
} else if (severity === "error") {
console.error(chalk.bold.red(msg));
} else {
console.log(msg);
}
}
示例6: function
stream.on('close', function() {
if (errorMsg.length > 0) {
console.log(chalk.bold.red('Error is:') + errorMsg);
console.log(chalk.red.bgBlack.bold('Unable to truncate metron_update table in HBase. Most likely reason is HBase is down !!!'));
reject();
} else {
console.log(chalk.bold.green('Truncated metron_update table in HBase'));
resolve();
}
conn.end();
}).on('data', function(data) {
示例7: createReporterError
export function createReporterError(
reporterIndex: number,
reporterValue: Array<Config.ReporterConfig> | string,
) {
const errorMessage =
` Reporter at index ${reporterIndex} must be of type:\n` +
` ${chalk.bold.green(validReporterTypes.join(' or '))}\n` +
` but instead received:\n` +
` ${chalk.bold.red(getType(reporterValue))}`;
return new ValidationError(ERROR, errorMessage, DOCUMENTATION_NOTE);
}
示例8: warn
export function warn(...args: any[]) {
if (args.length > 1) {
args[0] = chalk.bold.yellow(args[0]);
}
log.apply(console, args);
}