Support template literals for nested calls (#392)

Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
This commit is contained in:
Toon Baeyens 2020-06-09 09:36:34 +02:00 committed by GitHub
parent 55816cdd4d
commit 09ddbadcb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 61 additions and 2 deletions

View file

@ -215,10 +215,11 @@ console.log(chalk`
Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
Template styles are chained exactly like normal Chalk styles. The following two statements are equivalent:
Template styles are chained exactly like normal Chalk styles. The following three statements are equivalent:
```js
console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
console.log(chalk.bold.rgb(10, 100, 200)`Hello!`);
console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
```