From e525823f0acd910709b4eb23c5f075f03faeecfa Mon Sep 17 00:00:00 2001 From: Haider Date: Thu, 12 Mar 2020 03:31:15 +0530 Subject: [PATCH] Fix Chalk template literal parentheses Unmatched parentheses were causing error during svuelte usage from command line. --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index fc853a2..4d45f4f 100755 --- a/index.js +++ b/index.js @@ -311,14 +311,14 @@ if (sfc.script) { break; case 'beforeCreate': if (prop.type !== 'ObjectMethod') { - console.log(chalk`{yellow Warning: in default export, } {greenBright ${prop.key.name}} is not a function, ignoring it.}`); + console.log(chalk`{yellow Warning: in default export, {greenBright ${prop.key.name}} is not a function, ignoring it.}`); continue; } beforeCreate = unwrapFunctionBody(prop); break; case 'created': if (prop.type !== 'ObjectMethod') { - console.log(chalk`{yellow Warning: in default export, } {greenBright ${prop.key.name}} is not a function, ignoring it.}`); + console.log(chalk`{yellow Warning: in default export, {greenBright ${prop.key.name}} is not a function, ignoring it.}`); continue; } created = unwrapFunctionBody(prop); @@ -328,7 +328,7 @@ if (sfc.script) { case 'updated': case 'destroyed': if (prop.type !== 'ObjectMethod') { - console.log(chalk`{yellow Warning: in default export, } {greenBright ${prop.key.name}} is not a function, ignoring it.}`); + console.log(chalk`{yellow Warning: in default export, {greenBright ${prop.key.name}} is not a function, ignoring it.}`); continue; } @@ -394,7 +394,7 @@ if (sfc.script) { for (let method of prop.value.properties) { if (method.type !== 'ObjectMethod') { - console.log(chalk`{yellow Warning: in default export, method} {greenBright ${babelGenerator(method.key).code}} is not a function, ignoring it.}`); + console.log(chalk`{yellow Warning: in default export, method {greenBright ${babelGenerator(method.key).code}} is not a function, ignoring it.}`); continue; } @@ -457,4 +457,4 @@ if (sfc.template) { fs.writeFileSync(outputPath, output.join(''), 'utf8'); -console.log(chalk`{greenBright Successfully converted} {yellow ${inputPath}} {greenBright to} {yellow ${outputPath}}{greenBright . Please note that some manual corrections are probably still required.}`); \ No newline at end of file +console.log(chalk`{greenBright Successfully converted} {yellow ${inputPath}} {greenBright to} {yellow ${outputPath}}{greenBright . Please note that some manual corrections are probably still required.}`);