Support template literals for nested calls (#392)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
This commit is contained in:
parent
55816cdd4d
commit
09ddbadcb5
7 changed files with 61 additions and 2 deletions
|
|
@ -152,6 +152,11 @@ expectType<string>(chalk.bgWhiteBright`foo`);
|
|||
expectType<string>(chalk.red.bgGreen.underline('foo'));
|
||||
expectType<string>(chalk.underline.red.bgGreen('foo'));
|
||||
|
||||
// -- Complex template literal --
|
||||
expectType<string>(chalk.underline``);
|
||||
expectType<string>(chalk.red.bgGreen.bold`Hello {italic.blue ${name}}`);
|
||||
expectType<string>(chalk.strikethrough.cyanBright.bgBlack`Works with {reset {bold numbers}} {bold.red ${1}}`);
|
||||
|
||||
// -- Color types ==
|
||||
expectType<typeof chalk.Color>('red');
|
||||
expectError<typeof chalk.Color>('hotpink');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue