25 lines
698 B
TypeScript
25 lines
698 B
TypeScript
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);
|
|
}
|
|
}
|