Allow multiple arguments in base chalk object (fixes #187)
This commit is contained in:
parent
0827d3b632
commit
f0c0178d12
2 changed files with 8 additions and 3 deletions
7
index.js
7
index.js
|
|
@ -197,12 +197,13 @@ function applyStyle() {
|
|||
}
|
||||
|
||||
function chalkTag(chalk, strings) {
|
||||
const args = [].slice.call(arguments, 2);
|
||||
|
||||
if (!Array.isArray(strings)) {
|
||||
return strings.toString();
|
||||
// If chalk() was called by itself or with a string,
|
||||
// return the string itself as a string.
|
||||
return [].slice.call(arguments, 1).join(' ');
|
||||
}
|
||||
|
||||
const args = [].slice.call(arguments, 2);
|
||||
const parts = [strings.raw[0]];
|
||||
|
||||
for (let i = 1; i < strings.length; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue