This commit is contained in:
Maciej Caderek
2022-02-18 04:21:35 +01:00
parent 70b2245570
commit ec4a63b59b
8 changed files with 123 additions and 31 deletions

14
src/utils/isLink.ts Normal file
View File

@@ -0,0 +1,14 @@
const isLink = (text: string | null) => {
if (text === null) {
return false;
}
try {
new URL(text);
return true;
} catch {
return false;
}
};
export default isLink;