File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,11 @@ module.exports = {
35
35
const first3Lines = rawText . slice ( 0 , 3 ) ;
36
36
fullName = first3Lines . find ( ( line ) => (
37
37
line !== 'aps'
38
- && line !== ' Your electricity bill'
38
+ && ! line . match ( / Y o u r e l e c t r i c i t y b i l l ? / gi )
39
39
&& ! line . match ( / B i l l ? d a t e / gi)
40
40
&& ! line . match ( / \d + / g)
41
41
) ) ;
42
+
42
43
if ( ! fullName ) {
43
44
fullName = rawText . slice ( lineWithCityStateZipCodeIndex - 5 , lineWithCityStateZipCodeIndex + 5 )
44
45
. filter ( ( line ) => (
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ module.exports = {
48
48
if ( ! street_address_line_1 && lineWithCityStateZipIndex > 0 ) {
49
49
street_address_line_1 = rawText [ lineWithCityStateZipIndex - 1 ] ;
50
50
}
51
- if ( lineWithCityStateZip === street_address_line_2 || street_address_line_1 === street_address_line_2 ) {
51
+ if ( lineWithCityStateZip === street_address_line_2
52
+ || street_address_line_1 === street_address_line_2 ) {
52
53
// case of no street_address_line_2
53
54
street_address_line_2 = '' ;
54
55
}
Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ module.exports = {
43
43
first_name = customer . split ( ' or ' ) [ 0 ] . split ( ' ' ) . slice ( 0 , 1 ) . join ( ' ' ) ;
44
44
last_name = customer . split ( ' or ' ) [ 0 ] . split ( ' ' ) . slice ( 1 , 2 ) . join ( ' ' ) ;
45
45
}
46
- console . log ( customer ) ;
47
46
48
47
// street address line 1 & 2
49
48
const lineWithCityStateZipCodeIndex = rawText . findIndex ( ( line ) => line . match ( / ^ [ A - Z \s ] + [ A - Z ] { 2 } \d + - ? \d + $ / g) ) ;
You can’t perform that action at this time.
0 commit comments