fix(parser): make reactive-resume v3 parser more lenient with validation

This commit is contained in:
Amruth Pillai
2023-11-23 22:34:21 +01:00
parent 6e53a0f7a3
commit d36fc1b31d
3 changed files with 256 additions and 177 deletions

View File

@ -9,7 +9,9 @@ export const getInitials = (name: string) => {
return ((initials.shift()?.[1] || "") + (initials.pop()?.[1] || "")).toUpperCase();
};
export const isUrl = (string: string) => {
export const isUrl = (string: string | null | undefined) => {
if (!string) return false;
const urlRegex = /https?:\/\/[^ \n]+/i;
return urlRegex.test(string);