Skip to content

Commit

Permalink
Update findMatchingRowById to sanitize text
Browse files Browse the repository at this point in the history
  • Loading branch information
ngnathan committed Aug 21, 2024
1 parent f220478 commit 1bf8a8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/olive-hounds-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@connectk12/exceljs": patch
---

Update findMatchingRowById to sanitize text
5 changes: 3 additions & 2 deletions src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ export const findMatchingRowById = ({
}

const row = rows.find((row) => {
const lookupValue = sanitizeText(row.getCell(lookupCol).value?.toString());
return id === lookupValue;
const _id = sanitizeText(id);
const _lookupValue = sanitizeText(row.getCell(lookupCol).value?.toString());
return _id === _lookupValue;
});

if (!row && opts?.findSimilarMatchWithLastDigits) {
Expand Down

0 comments on commit 1bf8a8a

Please sign in to comment.