Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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.}`);
console.log(chalk`{greenBright Successfully converted} {yellow ${inputPath}} {greenBright to} {yellow ${outputPath}}{greenBright . Please note that some manual corrections are probably still required.}`);