Skip to content

Commit

Permalink
Added in utils file for checkimageurl
Browse files Browse the repository at this point in the history
  • Loading branch information
shoaiblatif22 committed Nov 18, 2023
1 parent 2e2d3f6 commit fd149ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions utils/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const checkImageURL = (url) => {
if (!url) return false
else {
const pattern = new RegExp('^https?:\\/\\/.+\\.(png|jpg|jpeg|bmp|gif|webp$)', 'i');
return pattern.test(url);
}
};

0 comments on commit fd149ba

Please sign in to comment.