feat(logger): new "url" format, add double quotes around paths (#7019)

* refactor(logger): add double quotes around paths

* Introduce url formatter

* Fix
This commit is contained in:
Alexey Pyltsyn 2022-03-27 09:59:20 +03:00 committed by GitHub
parent 2bcac29cd4
commit a307da0b9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 11 deletions

View file

@ -9,7 +9,8 @@ import chalk, {type Chalk} from 'chalk';
type InterpolatableValue = string | number | (string | number)[];
const path = (msg: unknown): string => chalk.cyan(chalk.underline(msg));
const path = (msg: unknown): string => chalk.cyan(chalk.underline(`"${msg}"`));
const url = (msg: unknown): string => chalk.cyan(chalk.underline(msg));
const name = (msg: unknown): string => chalk.blue(chalk.bold(msg));
const code = (msg: unknown): string => chalk.cyan(`\`${msg}\``);
const subdue: Chalk = chalk.gray;
@ -30,6 +31,8 @@ function interpolate(
switch (flag[0]) {
case 'path=':
return path;
case 'url=':
return url;
case 'number=':
return num;
case 'name=':
@ -131,6 +134,7 @@ const logger = {
bold: chalk.bold,
dim: chalk.dim,
path,
url,
name,
code,
subdue,