File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,12 +43,12 @@ const { __dirname: __dirname$1 } = currentModulePaths((typeof document === 'unde
4343
4444class JsdocCommand {
4545 constructor ( options = { } , cache ) {
46+ options . files = arrayify ( options . files ) ;
47+ options . source = arrayify ( options . source ) ;
4648 assert . ok (
47- options . files ? .length || options . source || options . configure ,
49+ options . files . length || options . source . length || options . configure ,
4850 'Must set at least one of .files, .source or .configure'
4951 ) ;
50- options . files = arrayify ( options . files ) ;
51- options . source = arrayify ( options . source ) ;
5252
5353 this . cache = cache ;
5454 this . tempFiles = [ ] ;
@@ -308,7 +308,7 @@ class JsdocOptions {
308308 this . readme = options . readme ;
309309
310310 /* Warning to avoid a common mistake where dmd templates are passed in.. a jsdoc template must be a filename. */
311- if ( options . template !== undefined && options . template ? .split ( / \r ? \n / ) ? .length !== 1 ) {
311+ if ( typeof options . template === 'string' && options . template . split ( / \r ? \n / ) . length !== 1 ) {
312312 console . warn ( 'Suspicious `options.template` value - the jsdoc `template` option must be a file path.' ) ;
313313 console . warn ( options . template ) ;
314314 }
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ class JsdocOptions {
140140 this . readme = options . readme
141141
142142 /* Warning to avoid a common mistake where dmd templates are passed in.. a jsdoc template must be a filename. */
143- if ( options . template !== undefined && options . template ? .split ( / \r ? \n / ) ? .length !== 1 ) {
143+ if ( typeof options . template === 'string' && options . template . split ( / \r ? \n / ) . length !== 1 ) {
144144 console . warn ( 'Suspicious `options.template` value - the jsdoc `template` option must be a file path.' )
145145 console . warn ( options . template )
146146 }
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ const { __dirname } = currentModulePaths(import.meta.url)
1010
1111class JsdocCommand {
1212 constructor ( options = { } , cache ) {
13+ options . files = arrayify ( options . files )
14+ options . source = arrayify ( options . source )
1315 assert . ok (
14- options . files ? .length || options . source || options . configure ,
16+ options . files . length || options . source . length || options . configure ,
1517 'Must set at least one of .files, .source or .configure'
1618 )
17- options . files = arrayify ( options . files )
18- options . source = arrayify ( options . source )
1919
2020 this . cache = cache
2121 this . tempFiles = [ ]
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ class Fixture {
2626 static createTmpFolder ( folder ) {
2727 try {
2828 fs . statSync ( folder )
29- fs . rmSync ( folder , { recursive : true } )
29+ /* rmdirSync is node v12 friendly */
30+ fs . rmdirSync ( folder , { recursive : true } )
3031 fs . mkdirSync ( folder )
3132 } catch ( err ) {
3233 fs . mkdirSync ( folder )
You can’t perform that action at this time.
0 commit comments