@@ -22,8 +22,8 @@ export default class Automizer implements IPresentationProps {
2222 this . templates = [ ] ;
2323 this . params = params ;
2424
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 + '/' : '' ;
2727
2828 this . timer = Date . now ( ) ;
2929 }
@@ -44,7 +44,7 @@ export default class Automizer implements IPresentationProps {
4444 * @return {Automizer } Instance of Automizer
4545 */
4646 public load ( location : string , name ?: string ) : this {
47- name = ( name === undefined ) ? location : name ;
47+ name = name === undefined ? location : name ;
4848 return this . loadTemplate ( location , name ) ;
4949 }
5050
@@ -62,7 +62,9 @@ export default class Automizer implements IPresentationProps {
6262 return this ;
6363 }
6464
65- isPresTemplate ( template : PresTemplate | RootPresTemplate ) : template is PresTemplate {
65+ isPresTemplate (
66+ template : PresTemplate | RootPresTemplate ,
67+ ) : template is PresTemplate {
6668 return 'name' in template ;
6769 }
6870
@@ -73,7 +75,11 @@ export default class Automizer implements IPresentationProps {
7375 * @param callback - Executed when slide is created. Passes the newly created slide
7476 * @return {Automizer } Instance of Automizer
7577 */
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 {
7783 if ( this . rootTemplate === undefined ) {
7884 throw new Error ( 'You have to set a root template first.' ) ;
7985 }
@@ -83,7 +89,7 @@ export default class Automizer implements IPresentationProps {
8389 const newSlide = new Slide ( {
8490 presentation : this ,
8591 template,
86- slideNumber
92+ slideNumber,
8793 } ) ;
8894
8995 if ( callback !== undefined ) {
@@ -97,7 +103,7 @@ export default class Automizer implements IPresentationProps {
97103 }
98104
99105 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 ) ;
101107 if ( template === undefined ) {
102108 throw new Error ( `Template not found: ${ name } ` ) ;
103109 }
@@ -111,9 +117,13 @@ export default class Automizer implements IPresentationProps {
111117 await this . rootTemplate . appendSlide ( slide ) ;
112118 }
113119
114- const content = await rootArchive . generateAsync ( { type : 'nodebuffer' } ) ;
120+ const content = await rootArchive . generateAsync ( { type : 'nodebuffer' } ) ;
115121
116- return FileHelper . writeOutputFile ( this . getLocation ( location , 'output' ) , content , this ) ;
122+ return FileHelper . writeOutputFile (
123+ this . getLocation ( location , 'output' ) ,
124+ content ,
125+ this ,
126+ ) ;
117127 }
118128
119129 private getLocation ( location : string , type ?: string ) : string {
0 commit comments