Skip to content

Commit 97355d3

Browse files
committed
fix aps fullname matching
1 parent 0cbb858 commit 97355d3

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

lib/documentTypes/apsBill.js

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,34 +31,18 @@ module.exports = {
3131
const keys = Object.keys(keyValues);
3232
const lineWithCityStateZipCodeIndex = rawText.findIndex((line) => line.match(/^[A-Z\s]+ [A-Z]{2} \d+-\d+$/g));
3333
let fullName;
34-
console.log('aps lineWithCityStateZipCodeIndex', lineWithCityStateZipCodeIndex);
34+
3535
const first3Lines = rawText.slice(0, 3);
3636
fullName = first3Lines.find((line) => (
3737
line !== 'aps'
3838
&& line !== 'Your electricity bill'
3939
&& !line.match(/Bill? date/gi)
4040
&& !line.match(/\d+/g)
4141
));
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-
}
5342
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];
5944
}
6045

61-
console.log('aps fullName', fullName);
6246
let first_name;
6347
let last_name;
6448
let street_address_line_1;

0 commit comments

Comments
 (0)