@@ -70,13 +70,6 @@ function getValidatedExtension(filename: string): ContentTypeExtension {
7070 return extension ;
7171}
7272
73- /**
74- * Media source configuration for loading media files.
75- */
76- type MediaSource =
77- | { source : 'path' ; dir ?: string ; prefix ?: string }
78- | { source : 'buffer' ; buffer : Buffer | Buffer [ ] ; prefix ?: string } ;
79-
8073/**
8174 * Automizer
8275 *
@@ -228,7 +221,7 @@ export default class Automizer implements IPresentationProps {
228221 if ( ! name && typeof file !== 'object' ) {
229222 name = name === undefined ? file : name ;
230223 } else if ( typeof file === 'object' && ! name ) {
231- throw 'Name is required when loading a template from a Buffer' ;
224+ throw new Error ( 'Name is required when loading a template from a Buffer' ) ;
232225 }
233226 return this . loadTemplate ( file , name ) ;
234227 }
@@ -280,7 +273,7 @@ export default class Automizer implements IPresentationProps {
280273 ) : this {
281274 const files = GeneralHelper . arrayify ( filename ) ;
282275 if ( ! this . rootTemplate ) {
283- throw new Error ( "Can't load media, you need to load a root template first" ) ;
276+ throw "Can't load media, you need to load a root template first" ;
284277 }
285278 files . forEach ( ( file ) => {
286279 const directory = dir || this . params . mediaDir ;
@@ -291,7 +284,6 @@ export default class Automizer implements IPresentationProps {
291284 } catch ( e ) {
292285 throw `Can't load media: ${ filepath } does not exist.` ;
293286 }
294-
295287 this . rootTemplate . mediaFiles . push ( {
296288 source : 'path' ,
297289 file,
0 commit comments