• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript chalk.bold类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript chalk.constructor类代码示例发布时间:2022-05-24
下一篇:
TypeScript chalk.blue类代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap