diff --git a/lib/documentTypes/apsBill.js b/lib/documentTypes/apsBill.js index f44d134..4900508 100644 --- a/lib/documentTypes/apsBill.js +++ b/lib/documentTypes/apsBill.js @@ -40,6 +40,17 @@ module.exports = { && !line.match(/\d+/g) )); if (!fullName) { + fullName = rawText.slice(lineWithCityStateZipCodeIndex - 5, lineWithCityStateZipCodeIndex + 5) + .filter((line) => ( + line.indexOf(' ') >= 0 + && line.toUpperCase() === line + && !line.match(/Total amount paid/gi) + && !line.match(/News from APS/gi) + && !line.match(/Things you need to know/gi) + && !line.match(/Visit aps/gi) + && !line.match(/Pay 24 hours/gi) + && !line.match(/Download our free/gi) + )).find((line) => !line.match(/\d+/g)); fullName = rawText[lineWithCityStateZipCodeIndex - 2]; }