Skip to content

Commit 07f24af

Browse files
committed
Fixup: messed up stash...
1 parent ea1d2d3 commit 07f24af

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

index.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ async function processFile(filename,
121121
return;
122122
}
123123

124-
let type = determineFileType(sourcePath);
125-
if(type && compactors[type]) {
126-
let compactor = compactors[type];
124+
let fileExtension = path.extname(sourcePath).substr(1).toLowerCase();
125+
if(fileExtension && compactors[fileExtension]) {
126+
let compactor = compactors[fileExtension];
127127
content = await compactor(content);
128128
}
129129

@@ -134,13 +134,3 @@ async function processFile(filename,
134134
}
135135
return assetManager.writeFile(targetPath, content, options);
136136
}
137-
138-
/**
139-
* The file type is the lowercase file extension
140-
*
141-
* @param {string} sourcePath
142-
* @returns {string}
143-
*/
144-
function determineFileType(sourcePath) {
145-
return path.extname(sourcePath).substr(1).toLowerCase();
146-
}

types.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,13 @@ export interface Compactor {
4747
}
4848

4949
export interface ProcessFile {
50-
(filename: string, opts: ProcessFileOpts): Promise<unknown>
51-
}
52-
53-
export interface ProcessFileOpts {
5450
source: string,
5551
target: string,
56-
writeFileOptions: WriteFileOpts,
52+
targetDir: string,
53+
fingerprint?: boolean,
54+
compactors: CompactorMap,
5755
assetManager: AssetManager,
56+
filter?: (filename: string) => boolean
5857
}
5958

6059
export interface FileFinderOptions {

0 commit comments

Comments
 (0)