function highlightTokens(defs: Object, text: string) {
  return text.replace(jsTokens, function(...args) {
    const type = getTokenType(args);
    const colorize = defs[type];
    if (colorize) {
      return args[0]
        .split(NEWLINE)
        .map(str => colorize(str))
        .join("\n");
    } else {
      return args[0];
    }
  });
}
function highlightTokens(defs: Object, text: string) {
  return text.replace(jsTokens, function(...args) {
    const type = getTokenType(args);
    const colorize = defs[type];
    if (colorize) {
      return args[0]
        .split(NEWLINE)
        .map(str => colorize(str))
        .join("\n");
    } else {
      return args[0];
    }
  });
}
function highlightTokens ( defs : Object , text : string ) { return text . replace ( jsTokens , function ( ... args ) { const type = getTokenType ( args ) ; const colorize = defs [ type ] ; if ( colorize ) { return args [ 0 ] . split ( NEWLINE ) . map ( str => colorize ( str ) ) . join ( "\n" ) ; } else { return args [ 0 ] ; } } ) ; }
Highlight `text` using the token definitions in `defs`.
Highlight text using the token definitions in defs .
Highlights tokens in text