File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
projects/ngx-mask-lib/src/lib Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -358,10 +358,11 @@ export class MaskApplierService {
358358 let res : string = x [ 0 ] ;
359359 const separatorLimit : string = this . separatorLimit . replace ( / \s / g, '' ) ;
360360 if ( separatorLimit && + separatorLimit ) {
361- if ( res [ 0 ] === '-' )
362- res = `-${ res . slice ( 1 , res . length ) . slice ( 0 , separatorLimit . length ) } ` ;
363- else
364- res = res . slice ( 0 , separatorLimit . length ) ;
361+ if ( res [ 0 ] === '-' ) {
362+ res = `-${ res . slice ( 1 , res . length ) . slice ( 0 , separatorLimit . length ) } ` ;
363+ } else {
364+ res = res . slice ( 0 , separatorLimit . length ) ;
365+ }
365366 }
366367 const rgx : RegExp = / ( \d + ) ( \d { 3 } ) / ;
367368 while ( rgx . test ( res ) ) {
@@ -410,7 +411,7 @@ export class MaskApplierService {
410411 return str
411412 . split ( '' )
412413 . filter ( ( i : string , idx : number ) => {
413- return i . match ( '^-?\\d' ) || i === '.' || i === ',' || ( i === '-' && idx == 0 )
414+ return i . match ( '^-?\\d' ) || i === '.' || i === ',' || ( i === '-' && idx === 0 ) ;
414415 } )
415416 . join ( '' ) ;
416417 }
You can’t perform that action at this time.
0 commit comments