add field mask
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
module TextUtils
|
||||
RTL_REGEXP = /[\p{Hebrew}\p{Arabic}]/
|
||||
MASK_REGEXP = /[^\s\-_\[\]\(\)\+\?\.\,]/
|
||||
MASK_SYMBOL = 'X'
|
||||
|
||||
module_function
|
||||
|
||||
@@ -13,6 +15,10 @@ module TextUtils
|
||||
false
|
||||
end
|
||||
|
||||
def mask_value(text)
|
||||
text.to_s.gsub(MASK_REGEXP, MASK_SYMBOL)
|
||||
end
|
||||
|
||||
def maybe_rtl_reverse(text)
|
||||
if text.match?(RTL_REGEXP)
|
||||
TwitterCldr::Shared::Bidi
|
||||
|
||||
Reference in New Issue
Block a user