Skip to content

Commit 5787c91

Browse files
refactor: redex without constructor
1 parent bb4b7f4 commit 5787c91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/helpers/regex.helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const socialNetworksUrlRegex = new RegExp(
22
'^(https?://)?(www.)?(facebook.com|fb.me|twitter.com|vxtwitter.com|instagram.com|linkedin.com|youtube.com|youtu.be|pinterest.com|snapchat.com|tiktok.com)/[a-zA-Z0-9.-/?=&#_]+$',
33
);
4-
const punctuationRegex = new RegExp(/[.,!?]/g);
5-
const emojiRegex = new RegExp(/(\p{Extended_Pictographic}|\p{Emoji_Component})/gu);
4+
const punctuationRegex = /[.,!?]/g;
5+
const emojiRegex = /(\p{Extended_Pictographic}|\p{Emoji_Component})/gu;
66

77
export const isASocialNetworkUrl = (url: string): boolean => {
88
return socialNetworksUrlRegex.test(url);

0 commit comments

Comments
 (0)