File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed
Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ const pkgName = '@adamlui/minify.js',
155155 } )
156156
157157 if ( config . dryRun ) { // -n or --dry-run passed
158- if ( unminnedJSfiles . length > 0 ) { // print files to be processed
158+ if ( unminnedJSfiles . length ) { // print files to be processed
159159 console . info ( `\n${ by + ( msgs . info_filesToBeMinned || 'JS files to be minified' ) } :${ nc } ` )
160160 unminnedJSfiles . forEach ( file => console . info ( file ) )
161161 } else console . info ( `\n${ by + ( msgs . info_noFilesWillBeMinned || 'No JS files will be minified' ) } .${ nc } ` )
@@ -172,13 +172,13 @@ const pkgName = '@adamlui/minify.js',
172172 } ) . filter ( minifyResult => ! minifyResult . error ) // filter out failed minifications
173173
174174 // Print minification summary
175- if ( minifyData ?. length > 0 ) {
175+ if ( minifyData ?. length ) {
176176 printIfNotQuiet ( `\n${ bg + ( msgs . info_minComplete || 'Minification complete' ) } !${ nc } ` )
177177 printIfNotQuiet ( `${ bw + minifyData . length } ${ msgs . info_file || 'file' } `
178178 + `${ minifyData . length > 1 ? 's' : '' } ${ msgs . info_minified || 'minified' } .${ nc } ` )
179179 } else printIfNotQuiet (
180180 `\n${ by + ( msgs . info_noFilesProcessed || 'No unminified JavaScript files processed' ) } .${ nc } ` )
181- if ( failedPaths . length > 0 ) {
181+ if ( failedPaths . length ) {
182182 printIfNotQuiet (
183183 `\n${ br + failedPaths . length } ${ msgs . info_file || 'file' } `
184184 + `${ failedPaths . length > 1 ? 's' : '' } ${ msgs . info_failedToMinify || 'failed to minify' } :${ nc } `
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ function findJS(searchDir, options = {}) {
6767 if ( findJS . caller . name != 'minify' && typeof window != 'undefined' )
6868 console . info ( 'findJS() » Check returned array.' )
6969 }
70- return options . isRecursing || jsFiles . length > 0 ? jsFiles : [ ]
70+ return options . isRecursing || jsFiles . length ? jsFiles : [ ]
7171}
7272
7373function minify ( input , options = { } ) {
@@ -121,7 +121,7 @@ function minify(input, options = {}) {
121121 return { code : minifyResult . code , srcPath : jsPath , error : minifyResult . error }
122122 } ) . filter ( data => ! data . error ) // filter out failed minifications
123123 if ( options . verbose ) {
124- if ( minifyResult . length > 0 && typeof window != 'undefined' ) console . info (
124+ if ( minifyResult . length && typeof window != 'undefined' ) console . info (
125125 'minify() » Minification complete! Check returned object.' )
126126 else console . info (
127127 'minify() » No unminified JavaScript files processed.' )
Original file line number Diff line number Diff line change 110110 } )
111111
112112 if ( config . dryRun ) { // -n or --dry-run passed
113- if ( scssFiles . length > 0 ) { // print files to be processed
113+ if ( scssFiles . length ) { // print files to be processed
114114 console . info ( `\n${ by } SCSS files to be compiled:${ nc } ` )
115115 scssFiles . forEach ( file => console . info ( file ) )
116116 } else console . info ( `${ by } \nNo SCSS files will be compiled.${ nc } ` )
129129 } ) . filter ( data => ! data . error ) // filter out failed compilations
130130
131131 // Print compilation summary
132- if ( compileData ?. length > 0 ) {
132+ if ( compileData ?. length ) {
133133 const cssCntSuffix = compileData . length > 1 ? 's' : ''
134134 printIfNotQuiet ( `\n${ bg } Compilation complete!${ nc } ` )
135135 printIfNotQuiet ( `${ bw + compileData . length } CSS file${ cssCntSuffix } `
136136 + ( ! config . noSourceMaps ? ` + ${ compileData . length } source map${ cssCntSuffix } ` : '' )
137137 + ' generated.' + nc )
138138 } else printIfNotQuiet ( `\n${ by } No SCSS files processed.${ nc } ` )
139- if ( failedPaths . length > 0 ) {
139+ if ( failedPaths . length ) {
140140 printIfNotQuiet ( `\n${ br } `
141141 + `${ failedPaths . length } file${ failedPaths . length > 1 ? 's' : '' } `
142142 + ` failed to compile:${ nc } ` )
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ function findSCSS(searchDir, options = {}) {
6565 if ( findSCSS . caller . name != 'compile' && typeof window != 'undefined' )
6666 console . info ( 'findSCSS() » Check returned array.' )
6767 }
68- return options . isRecursing || scssFiles . length > 0 ? scssFiles : [ ]
68+ return options . isRecursing || scssFiles . length ? scssFiles : [ ]
6969}
7070
7171function compile ( input , options = { } ) {
@@ -126,7 +126,7 @@ function compile(input, options = {}) {
126126 }
127127 } ) . filter ( data => ! data . error ) // filter out failed compilations
128128 if ( options . verbose ) {
129- if ( compileResult . length > 0 && typeof window != 'undefined' ) console . info (
129+ if ( compileResult . length && typeof window != 'undefined' ) console . info (
130130 'compile() » Compilation complete! Check returned object.' )
131131 else console . info (
132132 'compile() » No SCSS files processed.' )
You can’t perform that action at this time.
0 commit comments