feat(WEB-162): final design for my profile page
This commit is contained in:
committed by
Christel Westerberg
parent
a7b04df7b6
commit
5f3e417593
15
utils/maskValue.ts
Normal file
15
utils/maskValue.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
const emailRegex =
|
||||
/(?<=.)[^@\n](?=[^@\n]*?@)|(?:(?<=@.+)|(?!^)\G(?=[^@\n]*$)).(?=.*\.)/gm
|
||||
export function email(str: string) {
|
||||
return str.replace(emailRegex, "*")
|
||||
}
|
||||
|
||||
const phoneRegex = /.(?!.{0,1}$)/gm
|
||||
export function phone(str: string) {
|
||||
return str.replace(phoneRegex, "*")
|
||||
}
|
||||
|
||||
const textRegex = /(?!^)./gm
|
||||
export function text(str: string) {
|
||||
return str.replace(textRegex, "*")
|
||||
}
|
||||
Reference in New Issue
Block a user