Skip to content

Commit

Permalink
fix(Acronyms): Building name check
Browse files Browse the repository at this point in the history
Correctly handle acronyms in last segment of a building name
  • Loading branch information
cblanc committed Dec 14, 2023
1 parent b58b55d commit 3840b04
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ export const checkBuildingRange = (
): BuildingRangeMatch | void => {
const tokens = building_name.split(" ");
const range = tokens.pop() || "";
const tokenCopy = [...tokens];
const rangeCheck = tokenCopy.pop() || "";
if(isSingleCharacter(rangeCheck)) return

// Check if final token is single character [A-Z]
const rangeCheck = [...tokens].pop() || "";
if (isSingleCharacter(rangeCheck)) return;

if (range.match(BUILDING_RANGE_REGEX)) {
return {
range,
Expand Down

0 comments on commit 3840b04

Please sign in to comment.