File tree Expand file tree Collapse file tree 5 files changed +15
-14
lines changed Expand file tree Collapse file tree 5 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,12 @@ const { __dirname: __dirname$1 } = currentModulePaths((typeof document === 'unde
43
43
44
44
class JsdocCommand {
45
45
constructor ( options = { } , cache ) {
46
+ options . files = arrayify ( options . files ) ;
47
+ options . source = arrayify ( options . source ) ;
46
48
assert . ok (
47
- options . files ? .length || options . source || options . configure ,
49
+ options . files . length || options . source . length || options . configure ,
48
50
'Must set at least one of .files, .source or .configure'
49
51
) ;
50
- options . files = arrayify ( options . files ) ;
51
- options . source = arrayify ( options . source ) ;
52
52
53
53
this . cache = cache ;
54
54
this . tempFiles = [ ] ;
@@ -308,7 +308,7 @@ class JsdocOptions {
308
308
this . readme = options . readme ;
309
309
310
310
/* 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 ) {
312
312
console . warn ( 'Suspicious `options.template` value - the jsdoc `template` option must be a file path.' ) ;
313
313
console . warn ( options . template ) ;
314
314
}
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ class JsdocOptions {
140
140
this . readme = options . readme
141
141
142
142
/* 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 ) {
144
144
console . warn ( 'Suspicious `options.template` value - the jsdoc `template` option must be a file path.' )
145
145
console . warn ( options . template )
146
146
}
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ const { __dirname } = currentModulePaths(import.meta.url)
10
10
11
11
class JsdocCommand {
12
12
constructor ( options = { } , cache ) {
13
+ options . files = arrayify ( options . files )
14
+ options . source = arrayify ( options . source )
13
15
assert . ok (
14
- options . files ? .length || options . source || options . configure ,
16
+ options . files . length || options . source . length || options . configure ,
15
17
'Must set at least one of .files, .source or .configure'
16
18
)
17
- options . files = arrayify ( options . files )
18
- options . source = arrayify ( options . source )
19
19
20
20
this . cache = cache
21
21
this . tempFiles = [ ]
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ class Fixture {
26
26
static createTmpFolder ( folder ) {
27
27
try {
28
28
fs . statSync ( folder )
29
- fs . rmSync ( folder , { recursive : true } )
29
+ /* rmdirSync is node v12 friendly */
30
+ fs . rmdirSync ( folder , { recursive : true } )
30
31
fs . mkdirSync ( folder )
31
32
} catch ( err ) {
32
33
fs . mkdirSync ( folder )
You can’t perform that action at this time.
0 commit comments