Skip to content

Commit

Permalink
create hasURL
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Apr 26, 2024
1 parent 042c9a8 commit 65bdee1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/libs/Url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,10 @@ function appendParam(url: string, paramName: string, paramValue: string) {
return `${url}${separator}${paramName}=${paramValue}`;
}

export {addTrailingForwardSlash, hasSameExpensifyOrigin, getPathFromURL, appendParam};
function hasURL(text: string) {
const urlPattern = /((https|http)?:\/\/[^\s]+)/g;

return urlPattern.test(text);
}

export {addTrailingForwardSlash, hasSameExpensifyOrigin, getPathFromURL, appendParam, hasURL};

0 comments on commit 65bdee1

Please sign in to comment.