This commit is contained in:
waveringana 2023-11-18 12:53:15 -05:00
parent 807e50388a
commit 832189a346
10 changed files with 518 additions and 299 deletions

View file

@ -2,25 +2,45 @@
declare global {
namespace Express {
interface User {
id? : number | string,
username: string,
hashed_password?: any,
salt?: any
id?: number | string;
username: string;
hashed_password?: any;
salt?: any;
}
}
}
/**Splits a file name into its name and then its extension */
export function extension(str: string){
export function extension(str: string) {
const file = str.split("/").pop();
return [file.substr(0,file.lastIndexOf(".")),file.substr(file.lastIndexOf("."),file.length).toLowerCase()];
return [
file.substr(0, file.lastIndexOf(".")),
file.substr(file.lastIndexOf("."), file.length).toLowerCase(),
];
}
/**Type for user data */
export interface User {
id? : number | string,
username: string,
hashed_password?: any,
salt?: any
id?: number | string;
username: string;
hashed_password?: any;
salt?: any;
}
export const videoExtensions = [".mp4", ".mov", ".avi", ".flv", ".mkv", ".wmv", ".webm"];
export const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".svg", ".tiff", ".webp"];
export const videoExtensions = [
".mp4",
".mov",
".avi",
".flv",
".mkv",
".wmv",
".webm",
];
export const imageExtensions = [
".jpg",
".jpeg",
".png",
".gif",
".bmp",
".svg",
".tiff",
".webp",
];