How to use the figures function in figures

To help you get started, we’ve selected a few figures examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prescottprue / firebase-ci / src / utils / logger.ts View on Github external
function logType(type: LogType, message: string, other?: any): void {
  const icon: any = iconMapping[type];
  const prefix: any = (prefixMapping as any)[type];
  const colorLog = colorLogger(type);
  /* eslint-disable no-console */
  console.log(
    `${icon ? colorLog(fig(icon)) : ''} ${
      prefix ? colorLog(prefix) : ''
    }${message}`,
  );
  /* eslint-enable no-console */
  if (other) {
    console.log('\n', other); // eslint-disable-line no-console
  }
}
github prescottprue / firebase-ci / src / utils / logger.js View on Github external
function logType(type, message, other) {
  const icon = iconMapping[type]
  const prefix = prefixMapping[type]
  const colorLog = colorLogger(type)
  /* eslint-disable no-console */
  console.log(
    `${icon ? colorLog(fig(icon)) : ''} ${
      prefix ? colorLog(prefix) : ''
    }${message}`
  )
  /* eslint-enable no-console */
  if (other) {
    console.log('\n', other) // eslint-disable-line no-console
  }
}
github cucumber / cucumber-js / features / support / helpers.js View on Github external
export function normalizeText(text) {
  return figures(text)
    .replace(/\033\[[0-9;]*m/g, '')
    .replace(/\r\n|\r/g, '\n')
    .trim()
    .replace(/[ \t]+\n/g, '\n')
    .replace(/\d+m\d{2}\.\d{3}s/, '')
    .replace(/\d+(.\d+)?ms/g, 'ms')
    .replace(/\//g, path.sep)
    .replace(/ +/g, ' ')
    .split('\n')
    .map(line => line.trim())
    .join('\n')
}
github pandonetwork / pando / packages / git-pando / src / ui / display.ts View on Github external
export const list = (entries: any[]) => {
  for (const entry of entries) {
    if (entry.current) {
      console.log(figures('❯ ') + chalk.green(entry.name))
    } else {
      console.log(figures('  ') + entry.name)
    }
  }
}
github pandonetwork / pando / packages / git-pando / src / ui / display.ts View on Github external
export const list = (entries: any[]) => {
  for (const entry of entries) {
    if (entry.current) {
      console.log(figures('❯ ') + chalk.green(entry.name))
    } else {
      console.log(figures('  ') + entry.name)
    }
  }
}
github nuxt / consola / src / reporters / fancy.js View on Github external
import chalk from 'chalk'
import BasicReporter from './basic'
import { parseStack } from '../utils/error'
import { chalkColor, chalkBgColor } from '../utils/chalk'
import { TYPE_COLOR_MAP, LEVEL_COLOR_MAP } from '../utils/fancy'

const DEFAULTS = {
  secondaryColor: 'grey',
  formatOptions: {
    colors: true,
    compact: false
  }
}

const TYPE_ICONS = {
  info: figures('ℹ'),
  success: figures('✔'),
  debug: figures('›'),
  trace: figures('›'),
  log: ''
}

export default class FancyReporter extends BasicReporter {
  constructor (options) {
    super(Object.assign({}, DEFAULTS, options))
  }

  formatStack (stack) {
    const grey = chalkColor('grey')
    const cyan = chalkColor('cyan')

    return '\n' + parseStack(stack)