10 lines
223 B
TypeScript
10 lines
223 B
TypeScript
import fs from "fs";
|
|
|
|
/**
|
|
* Deletes a file if it exists. Silently ignores missing files.
|
|
*/
|
|
export function deleteFileIfExists(filePath: string): void {
|
|
if (fs.existsSync(filePath)) {
|
|
fs.unlinkSync(filePath);
|
|
}
|
|
}
|