WIP
This commit is contained in:
14
src/utils/isLink.ts
Normal file
14
src/utils/isLink.ts
Normal 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;
|
||||
Reference in New Issue
Block a user