@@ -10,8 +10,7 @@ import { cardExpiry } from '../../custom_formatters/card_expiry';
10
10
const persianNumeral = [ '۰' , '۱' , '۲' , '۳' , '۴' , '۵' , '۶' , '۷' , '۸' , '۹' ] ;
11
11
12
12
function CustomNumeralNumericFormat ( props ) {
13
- const { format, removeFormatting, isCharacterSame, ...rest } =
14
- useNumericFormat ( props ) ;
13
+ const { format, removeFormatting, isCharacterSame, ...rest } = useNumericFormat ( props ) ;
15
14
16
15
const _format = ( val ) => {
17
16
const _val = format ( val ) ;
@@ -20,21 +19,16 @@ function CustomNumeralNumericFormat(props) {
20
19
} ;
21
20
22
21
const _removeFormatting = ( val ) => {
23
- const _val = val . replace ( new RegExp ( persianNumeral . join ( "|" ) , "g" ) , ( $1 ) =>
24
- persianNumeral . indexOf ( $1 )
22
+ const _val = val . replace ( new RegExp ( persianNumeral . join ( '|' ) , 'g' ) , ( $1 ) =>
23
+ persianNumeral . indexOf ( $1 ) ,
25
24
) ;
26
25
27
26
return removeFormatting ( _val ) ;
28
27
} ;
29
28
30
29
const _isCharacterSame = ( compareMeta ) => {
31
30
const isCharSame = isCharacterSame ( compareMeta ) ;
32
- const {
33
- formattedValue,
34
- currentValue,
35
- formattedValueIndex,
36
- currentValueIndex,
37
- } = compareMeta ;
31
+ const { formattedValue, currentValue, formattedValueIndex, currentValueIndex } = compareMeta ;
38
32
const curChar = currentValue [ currentValueIndex ] ;
39
33
const newChar = formattedValue [ formattedValueIndex ] ;
40
34
const curPersianChar = persianNumeral [ Number ( curChar ) ] ?? curChar ;
0 commit comments