Skip to content

Commit 97f4f21

Browse files
committed
optimized code
1 parent 14bc980 commit 97f4f21

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/parser/style.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@ type StyleObjectType = {
1313
function styleParser(styleObjectArray: StyleObjectType[]): Promise<string> {
1414
return new Promise((resolve) => {
1515
let output = '';
16-
if (!styleObjectArray || styleObjectArray.length === 0) {
17-
resolve(output);
18-
} else {
16+
if (styleObjectArray && styleObjectArray.length > 0) {
1917
for (const styleObject of styleObjectArray) {
2018
if(styleObject.lang === 'scss' || styleObject.lang === 'less') {
2119
console.error('Sorry please only use plain CSS in your files for now');
2220
}
2321
output += new CleanCSS({}).minify(styleObject.content).styles;
2422
}
25-
resolve(output);
2623
}
24+
resolve(output);
2725
});
2826
}
2927

0 commit comments

Comments
 (0)