File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -31,34 +31,18 @@ module.exports = {
31
31
const keys = Object . keys ( keyValues ) ;
32
32
const lineWithCityStateZipCodeIndex = rawText . findIndex ( ( line ) => line . match ( / ^ [ A - Z \s ] + [ A - Z ] { 2 } \d + - \d + $ / g) ) ;
33
33
let fullName ;
34
- console . log ( 'aps lineWithCityStateZipCodeIndex' , lineWithCityStateZipCodeIndex ) ;
34
+
35
35
const first3Lines = rawText . slice ( 0 , 3 ) ;
36
36
fullName = first3Lines . find ( ( line ) => (
37
37
line !== 'aps'
38
38
&& line !== 'Your electricity bill'
39
39
&& ! line . match ( / B i l l ? d a t e / gi)
40
40
&& ! line . match ( / \d + / g)
41
41
) ) ;
42
- console . log ( 'aps fullName' , fullName ) ;
43
- if ( ! fullName ) {
44
- const last7Lines = rawText . slice ( - 7 ) ;
45
- fullName = last7Lines . find ( ( line ) => (
46
- ! line . match ( / \d + / g)
47
- && line === line . toUpperCase ( )
48
- && line . length >= 6
49
- ) ) ;
50
- console . log ( 'aps last7Lines' , last7Lines ) ;
51
- console . log ( 'aps fullName1' , fullName ) ;
52
- }
53
42
if ( ! fullName ) {
54
- fullName = rawText . slice ( lineWithCityStateZipCodeIndex - 5 , 10 ) . find ( ( line ) => (
55
- line === line . toUpperCase ( )
56
- && line . indexOf ( ' ' ) >= 0
57
- ) ) ;
58
- console . log ( 'aps fullName2' , fullName ) ;
43
+ fullName = rawText [ lineWithCityStateZipCodeIndex - 2 ] ;
59
44
}
60
45
61
- console . log ( 'aps fullName' , fullName ) ;
62
46
let first_name ;
63
47
let last_name ;
64
48
let street_address_line_1 ;
You can’t perform that action at this time.
0 commit comments