Skip to content

Commit

Permalink
Resolve issue with sanitizeText opts?.removeWhitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ngnathan committed Sep 17, 2024
1 parent 9c7dae3 commit c8b4c0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/dull-balloons-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@connectk12/exceljs": patch
---

Resolve issue with sanitizeText opts?.removeWhitespace
2 changes: 1 addition & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const sanitizeText = <T extends string | (string | undefined)>(
sanitizedText = sanitizedText.replace(/[^a-zA-Z0-9\s]/g, "");
}
if (opts.removeWhitespace) {
sanitizedText = sanitizedText.replace(/\s+/g, " ");
sanitizedText = sanitizedText.replace(/\s+/g, "");
}
if (opts.uppercase) {
sanitizedText = sanitizedText.toLocaleUpperCase();
Expand Down

0 comments on commit c8b4c0f

Please sign in to comment.