From 12e4ce0e19c3346ccb973ea68704c103f69842a8 Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Tue, 24 Oct 2023 16:22:19 +0200 Subject: [PATCH] Fix overly permissive regex --- packages/app/src/providers/h5grove/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app/src/providers/h5grove/utils.ts b/packages/app/src/providers/h5grove/utils.ts index eb9e87d34..d7658ee7e 100644 --- a/packages/app/src/providers/h5grove/utils.ts +++ b/packages/app/src/providers/h5grove/utils.ts @@ -54,11 +54,11 @@ export function convertH5GroveDtype(dtype: H5GroveDtype): DType { } function convertDtypeString(dtype: string): DType { - const regexp = /([<>=|])?([A-z])(\d*)/u; + const regexp = /([<>=|])?([A-Za-z])(\d*)/u; const matches = regexp.exec(dtype); if (matches === null) { - throw new Error(`Unknown dtype ${dtype}`); + throw new Error(`Invalid dtype string: ${dtype}`); } const [, endianMatch, dataType, lengthMatch] = matches;