Extract consts

This commit is contained in:
Andras Schmelczer 2025-11-22 20:52:30 +00:00
parent aa3c587002
commit 4fcd134e55
2 changed files with 4 additions and 1 deletions

View file

@ -4,3 +4,4 @@ export const DIFF_CACHE_SIZE_MB = 2;
export const MAX_LOG_MESSAGE_COUNT = 100000;
export const MAX_HISTORY_ENTRY_COUNT = 5000;
export const TIMEOUT_FOR_MERGING_HISTORY_ENTRIES_IN_SECONDS = 60;
export const MERGABLE_FILE_TYPES = ["md", "txt"];

View file

@ -1,6 +1,8 @@
import { MERGABLE_FILE_TYPES } from "../consts";
export function isFileTypeMergable(pathOrFileName: string): boolean {
const parts = pathOrFileName.split(".");
const fileExtension = parts.at(-1) ?? "";
return ["md", "txt"].includes(fileExtension.toLowerCase());
return MERGABLE_FILE_TYPES.includes(fileExtension.toLowerCase());
}