Upload files to "/"
This commit is contained in:
24
global.ts
Normal file
24
global.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export let show_splash: boolean = true;
|
||||
|
||||
export const getShowSplash = () => show_splash;
|
||||
export const setShowSplash = (value: boolean) => {
|
||||
show_splash = value;
|
||||
};
|
||||
|
||||
export async function validate_password(password: string): Promise<boolean> {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
const securePasswordRegex =
|
||||
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@${}\[\]()/\\`"':;,.!%*?&^<>~_\-])[A-Za-z\d@${}\[\]()/\\`"':;,.!%*?&^<>~_\-]{8,}$/;
|
||||
resolve(securePasswordRegex.test(password));
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
export async function open_website(url: string) {
|
||||
try {
|
||||
open(url);
|
||||
} catch (error) {
|
||||
console.error("Failed to open the website:", error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user