Skip to content

Commit

Permalink
fix: restore the typeof check
Browse files Browse the repository at this point in the history
  • Loading branch information
dima-safin-2025 committed Jul 26, 2024
1 parent 1bc30a4 commit 16c7396
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { strip0x } from '@hyperlane-xyz/utils';
// Only allows letters and numbers
const alphanumericRgex = /[^a-zA-Z0-9]/gi;
export function sanitizeString(str: string) {
if (!str) return '';
if (!str || typeof str !== 'string') return '';
return str.replaceAll(alphanumericRgex, '').toLowerCase();
}

Expand Down

0 comments on commit 16c7396

Please sign in to comment.