chalk#italic TypeScript Examples

The following examples show how to use chalk#italic. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: reportPreviewer.ts    From cli with Apache License 2.0 6 votes vote down vote up
private static printAbridgedMessages(
    messages: string[],
    plurable: Plurable,
    chalker: ChalkFunction
  ) {
    let remainingErrorsToPrint = ReportViewer.maximumNumberOfErrorsToPrint;
    for (let j = 0; j < messages.length && remainingErrorsToPrint > 0; j++) {
      CliUx.ux.log(chalker(`  • ${messages[j]}`));
      remainingErrorsToPrint--;
    }

    const unprintedMessages =
      messages.length - ReportViewer.maximumNumberOfErrorsToPrint;
    if (unprintedMessages > 0) {
      CliUx.ux.log(
        italic(
          `  (${unprintedMessages} more ${pluralizeIfNeeded(
            plurable,
            unprintedMessages
          )})`
        )
      );
    }
  }