File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ This is a project that contains two tasks. You can trigger them manually or setu
10
10
11
11
** Output** : ` Continente Porto `
12
12
13
+ This task will also remove extra space in the payee name.
14
+ ** Input** : ` Continente Porto `
15
+
16
+ ** Output** : ` Continente Porto `
17
+
13
18
### Create a transaction that deducts your payment mortgage
14
19
To configure the correct interest rate is the % multiple by 1000
15
20
Original file line number Diff line number Diff line change @@ -9,8 +9,13 @@ async function fixPayees() {
9
9
payees = await getPayees ( actual , appConfig . PAYEE_REGEX_MATCH )
10
10
updatedPayee = { }
11
11
payees . forEach ( payee => {
12
- let name = payee . name . replace ( new RegExp ( appConfig . PAYEE_REGEX_MATCH , "gis" ) , "" ) ;
13
- if ( name != payee . name )
12
+ let name = payee . name ;
13
+ if ( appConfig . PAYEE_REGEX_MATCH != "" )
14
+ {
15
+ name = payee . name . replace ( new RegExp ( appConfig . PAYEE_REGEX_MATCH , "gis" ) , "" ) ;
16
+ }
17
+ name = name . replace ( new RegExp ( " {2,}" , "gis" ) , " " )
18
+ if ( name != payee . name )
14
19
{
15
20
updatedPayee [ payee . id ] = name . trim ( ) ;
16
21
console . log ( "Update payee from " + payee . name + " to " + name . trim ( ) )
You can’t perform that action at this time.
0 commit comments