improvements + better error handling

This commit is contained in:
Daniel
2023-07-24 09:39:51 -04:00
parent 6708be2dfd
commit cbf53f6e30
4 changed files with 51 additions and 28 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ export default async function getTitle(url: string) {
// regular expression to find the <title> tag
let match = text.match(/<title.*>([^<]*)<\/title>/);
if (match) return match[1] + " [AUTO GENERATED]";
if (match) return match[1];
else return "";
} catch (err) {
console.log(err);