Skip to content

Commit

Permalink
fix(filecheck): make options optional + add type
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner authored and LeoMcA committed Jun 20, 2022
1 parent 7076653 commit e586032
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions filecheck/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ function formatSize(bytes) {
return `${bytes}b`;
}

export async function checkFile(filePath, options) {
interface CheckerOptions {
saveCompression?: boolean;
}

export async function checkFile(filePath, options: CheckerOptions = {}) {
// Check that the filename is always lowercase.
if (path.basename(filePath) !== path.basename(filePath).toLowerCase()) {
throw new Error(
Expand Down Expand Up @@ -198,6 +202,6 @@ export async function checkFile(filePath, options) {
}
}

export async function runChecker(files, options) {
export async function runChecker(files, options: CheckerOptions) {
return Promise.all(files.map((f) => checkFile(f, options)));
}

0 comments on commit e586032

Please sign in to comment.