Skip to content

Commit

Permalink
update xpdf version, remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwansim committed Sep 14, 2024
1 parent 0367812 commit 6fe2310
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:12.10.0

ARG XPDF_VERSION=4.04
ARG XPDF_VERSION=4.05

# https://stackoverflow.com/a/76095392/7051239
RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \
Expand Down
15 changes: 4 additions & 11 deletions lib/extract-rentstab-units.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export function extractRentStabilizedUnits(text: string): number|null {
const re = /(?:Housing-Rent\s+Stabilization|Rent\s+Stabilization(?:\s+Fee)?-\s+Chg)\s+(\d+)/ig;
export function extractRentStabilizedUnits(text: string): number | null {
const re =
/(?:Housing-Rent\s+Stabilization|Rent\s+Stabilization(?:\s+Fee)?-\s+Chg)\s+(\d+)/gi;
let total = 0;
let match: RegExpExecArray|null = null;
let match: RegExpExecArray | null = null;

do {
match = re.exec(text);
Expand All @@ -11,12 +12,4 @@ export function extractRentStabilizedUnits(text: string): number|null {
} while (match);

return total === 0 ? null : total;
/* TODO: potential solutions to double counting
* 1. return 9999 if there's more than 1 match for manual flagging
Q: are there examples of rent stab units showing up partially to form a total sum?
* 2. execute do while loop just once
*
* test on regex101.com
* (?:Housing-Rent\s+Stabilization|Rent\s+Stabilization(?:\s+Fee)?-\s+Chg)\s+(\d+)
*/
}

0 comments on commit 6fe2310

Please sign in to comment.