当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript chalk.bold类代码示例

本文整理汇总了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
        });
      }
    });
开发者ID:felixrieseberg,项目名称:windows-build-tools,代码行数:29,代码来源:index.ts

示例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');
  }
开发者ID:Volune,项目名称:jest,代码行数:32,代码来源:SnapshotInteractiveMode.ts

示例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;
}
开发者ID:Volune,项目名称:jest,代码行数:28,代码来源:enhanceUnexpectedTokenMessage.ts

示例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);
   }
 });
开发者ID:,项目名称:,代码行数:32,代码来源:

示例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);
    }
}
开发者ID:rfrerebe,项目名称:Fable,代码行数:9,代码来源:index.ts

示例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) {
开发者ID:JonZeolla,项目名称:incubator-metron,代码行数:11,代码来源:clean_metron_update_table.ts

示例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);
}
开发者ID:Volune,项目名称:jest,代码行数:12,代码来源:ReporterValidationErrors.ts

示例8: warn

export function warn(...args: any[]) {
  if (args.length > 1) {
    args[0] = chalk.bold.yellow(args[0]);
  }

  log.apply(console, args);
}
开发者ID:janpersiel,项目名称:stylegen,代码行数:7,代码来源:Logger.ts


注:本文中的chalk.bold类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。