22 lines
559 B
TypeScript
22 lines
559 B
TypeScript
export type DLC = {
|
|
id: string;
|
|
name: string | null;
|
|
dlcIds: {
|
|
steam: string;
|
|
epic: string;
|
|
grdk: string;
|
|
};
|
|
};
|
|
|
|
export const getFileName = (iconFilePath: string): string => {
|
|
const base = iconFilePath.split('/').pop() ?? '';
|
|
return base.split('.')[0];
|
|
};
|
|
|
|
export const cleanFolderName = (name: string): string =>
|
|
name.replace(/[\\/:*?"<>|]/g, '_');
|
|
|
|
export const isKiller = (idx: number): boolean => idx >= 268435456;
|
|
|
|
export const isNamedDLC = (dlc: DLC): dlc is DLC & { name: string } =>
|
|
!!dlc.name && !dlc.name.startsWith('@'); |