Skip to content

Commit 5bf15f6

Browse files
committed
more cleanup
1 parent 9400be5 commit 5bf15f6

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

src/automizer.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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,

src/helper/modify-image-helper.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export default class ModifyImageHelper {
5959
'Media file not found in template archive in path: ' + filename,
6060
);
6161
}
62-
6362
const buffer = getMediaBuffer(mediaFile, fs.readFileSync);
6463
const _dimensions = imageSize(buffer);
6564
newImageDimensions.width = _dimensions.width;

0 commit comments

Comments
 (0)