From 0e3d36711d765994192c4da0e55a83ff445af328 Mon Sep 17 00:00:00 2001 From: James P Date: Thu, 18 Apr 2024 08:35:59 -0500 Subject: [PATCH] Performance change --- src/misc.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/misc.ts b/src/misc.ts index 2c0ce0c..bdb97fa 100644 --- a/src/misc.ts +++ b/src/misc.ts @@ -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); }