Temp commit to merge main into this branch

This commit is contained in:
Koper
2023-12-04 20:54:54 +07:00
parent ba40d28152
commit 999a3e05a4
8 changed files with 310 additions and 118 deletions

View File

@@ -121,3 +121,13 @@ export const generateHighContrastColor = (
return getCssColor(red, green, blue);
};
export function extractDomain(url) {
try {
const parsedUrl = new URL(url);
return parsedUrl.host;
} catch (error) {
console.error("Invalid URL:", error.message);
return null;
}
}