@@ -10,8 +10,7 @@ import { cardExpiry } from '../../custom_formatters/card_expiry';
1010const persianNumeral = [ '۰' , '۱' , '۲' , '۳' , '۴' , '۵' , '۶' , '۷' , '۸' , '۹' ] ;
1111
1212function CustomNumeralNumericFormat ( props ) {
13- const { format, removeFormatting, isCharacterSame, ...rest } =
14- useNumericFormat ( props ) ;
13+ const { format, removeFormatting, isCharacterSame, ...rest } = useNumericFormat ( props ) ;
1514
1615 const _format = ( val ) => {
1716 const _val = format ( val ) ;
@@ -20,21 +19,16 @@ function CustomNumeralNumericFormat(props) {
2019 } ;
2120
2221 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 ) ,
2524 ) ;
2625
2726 return removeFormatting ( _val ) ;
2827 } ;
2928
3029 const _isCharacterSame = ( compareMeta ) => {
3130 const isCharSame = isCharacterSame ( compareMeta ) ;
32- const {
33- formattedValue,
34- currentValue,
35- formattedValueIndex,
36- currentValueIndex,
37- } = compareMeta ;
31+ const { formattedValue, currentValue, formattedValueIndex, currentValueIndex } = compareMeta ;
3832 const curChar = currentValue [ currentValueIndex ] ;
3933 const newChar = formattedValue [ formattedValueIndex ] ;
4034 const curPersianChar = persianNumeral [ Number ( curChar ) ] ?? curChar ;
0 commit comments