@@ -21,11 +21,11 @@ const polyfill = () => {
21
21
global . document = { body } ;
22
22
23
23
const baseUrl = path . join ( __dirname ) ;
24
- const paths = p => path . join ( baseUrl , p ) ;
24
+ const paths = ( p ) => path . join ( baseUrl , p ) ;
25
25
global . paths = paths ;
26
26
} ;
27
27
28
- const processingJson = data => {
28
+ const processingJson = ( data ) => {
29
29
const json = [ ] ;
30
30
for ( let key in data ) {
31
31
const list = data [ key ] ;
@@ -34,30 +34,30 @@ const processingJson = data => {
34
34
json . push ( {
35
35
name : key + "::" + item . title ,
36
36
value : item . title ,
37
- func : demoFunc ( `${ key } /${ item . entry } ` )
37
+ func : demoFunc ( `${ key } /${ item . entry } ` ) ,
38
38
} ) ;
39
39
}
40
40
}
41
41
42
42
json . push ( {
43
43
name : "Clear cache" ,
44
44
value : "Clear cache" ,
45
- func : removeFiles
45
+ func : removeFiles ,
46
46
} ) ;
47
47
48
48
json . push ( new inquirer . Separator ( ) ) ;
49
49
return json ;
50
50
} ;
51
51
52
52
let now ;
53
- const screenshots = name => {
53
+ const screenshots = ( name ) => {
54
54
name = name . replace ( / \/ / gi, "-" ) ;
55
55
const dir = path . join ( __dirname , "output" , name ) ;
56
56
fs . ensureDir ( dir ) ;
57
57
id = setInterval ( saveFiles , 1000 / 2 , dir ) ;
58
58
} ;
59
59
60
- const saveFiles = dir => {
60
+ const saveFiles = ( dir ) => {
61
61
if ( index >= 20 ) {
62
62
clearInterval ( id ) ;
63
63
index = 0 ;
@@ -71,7 +71,7 @@ const saveFiles = dir => {
71
71
fs . outputFile ( file , buffer ) ;
72
72
} ;
73
73
74
- const demoFunc = name => {
74
+ const demoFunc = ( name ) => {
75
75
const url = path . join ( __dirname , "./source/node/" , `${ name } ` ) ;
76
76
77
77
return ( ) => {
@@ -81,7 +81,7 @@ const demoFunc = name => {
81
81
} ;
82
82
83
83
const choices = processingJson ( data ) ;
84
- const runDemo = answer => {
84
+ const runDemo = ( answer ) => {
85
85
for ( let i = 0 ; i < choices . length ; i ++ ) {
86
86
const choice = choices [ i ] ;
87
87
if ( choice . value === answer . val ) {
@@ -105,13 +105,13 @@ const initCommand = () => {
105
105
name : "val" ,
106
106
choices,
107
107
pageSize : choices . length ,
108
- validate : function ( answer ) {
108
+ validate : function ( answer ) {
109
109
if ( answer . length < 1 ) {
110
110
return "You must choose at least one topping." ;
111
111
}
112
112
return true ;
113
- }
114
- }
113
+ } ,
114
+ } ,
115
115
] )
116
116
. then ( runDemo ) ;
117
117
} ;
0 commit comments