@@ -22,8 +22,8 @@ export default class Automizer implements IPresentationProps {
22
22
this . templates = [ ] ;
23
23
this . params = params ;
24
24
25
- this . templateDir = ( params ?. templateDir ) ? params . templateDir + '/' : '' ;
26
- this . outputDir = ( params ?. outputDir ) ? params . outputDir + '/' : '' ;
25
+ this . templateDir = params ?. templateDir ? params . templateDir + '/' : '' ;
26
+ this . outputDir = params ?. outputDir ? params . outputDir + '/' : '' ;
27
27
28
28
this . timer = Date . now ( ) ;
29
29
}
@@ -44,7 +44,7 @@ export default class Automizer implements IPresentationProps {
44
44
* @return {Automizer } Instance of Automizer
45
45
*/
46
46
public load ( location : string , name ?: string ) : this {
47
- name = ( name === undefined ) ? location : name ;
47
+ name = name === undefined ? location : name ;
48
48
return this . loadTemplate ( location , name ) ;
49
49
}
50
50
@@ -62,7 +62,9 @@ export default class Automizer implements IPresentationProps {
62
62
return this ;
63
63
}
64
64
65
- isPresTemplate ( template : PresTemplate | RootPresTemplate ) : template is PresTemplate {
65
+ isPresTemplate (
66
+ template : PresTemplate | RootPresTemplate ,
67
+ ) : template is PresTemplate {
66
68
return 'name' in template ;
67
69
}
68
70
@@ -73,7 +75,11 @@ export default class Automizer implements IPresentationProps {
73
75
* @param callback - Executed when slide is created. Passes the newly created slide
74
76
* @return {Automizer } Instance of Automizer
75
77
*/
76
- public addSlide ( name : string , slideNumber : number , callback ?: ( slide : Slide ) => void ) : this {
78
+ public addSlide (
79
+ name : string ,
80
+ slideNumber : number ,
81
+ callback ?: ( slide : Slide ) => void ,
82
+ ) : this {
77
83
if ( this . rootTemplate === undefined ) {
78
84
throw new Error ( 'You have to set a root template first.' ) ;
79
85
}
@@ -83,7 +89,7 @@ export default class Automizer implements IPresentationProps {
83
89
const newSlide = new Slide ( {
84
90
presentation : this ,
85
91
template,
86
- slideNumber
92
+ slideNumber,
87
93
} ) ;
88
94
89
95
if ( callback !== undefined ) {
@@ -97,7 +103,7 @@ export default class Automizer implements IPresentationProps {
97
103
}
98
104
99
105
public getTemplate ( name : string ) : PresTemplate {
100
- const template = this . templates . find ( t => t . name === name ) ;
106
+ const template = this . templates . find ( ( t ) => t . name === name ) ;
101
107
if ( template === undefined ) {
102
108
throw new Error ( `Template not found: ${ name } ` ) ;
103
109
}
@@ -111,9 +117,13 @@ export default class Automizer implements IPresentationProps {
111
117
await this . rootTemplate . appendSlide ( slide ) ;
112
118
}
113
119
114
- const content = await rootArchive . generateAsync ( { type : 'nodebuffer' } ) ;
120
+ const content = await rootArchive . generateAsync ( { type : 'nodebuffer' } ) ;
115
121
116
- return FileHelper . writeOutputFile ( this . getLocation ( location , 'output' ) , content , this ) ;
122
+ return FileHelper . writeOutputFile (
123
+ this . getLocation ( location , 'output' ) ,
124
+ content ,
125
+ this ,
126
+ ) ;
117
127
}
118
128
119
129
private getLocation ( location : string , type ?: string ) : string {
0 commit comments