Skip to content

Commit

Permalink
Performance change
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Apr 18, 2024
1 parent c67818a commit 0e3d367
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const greekLetterNames = [
'Omega',
];

const hexRegex = /^[0-9a-f-.]+$/;

export function isHex(str: string) {
return /^[0-9a-f-.]+$/.test(str);
return hexRegex.test(str);
}

0 comments on commit 0e3d367

Please sign in to comment.