Files
angelc2/global.ts
2025-12-22 15:13:52 +00:00

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);
}
}