From fa8f3f9465e87d499f7d6428323f496a884b7818 Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Sat, 10 May 2025 16:57:03 -0700 Subject: initial commit --- utils/validate_identifier.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 utils/validate_identifier.ts (limited to 'utils/validate_identifier.ts') diff --git a/utils/validate_identifier.ts b/utils/validate_identifier.ts new file mode 100644 index 0000000..c8a5213 --- /dev/null +++ b/utils/validate_identifier.ts @@ -0,0 +1,3 @@ +export const validateIdentifier = (token: string) => { + return (/^[a-zA-Z0-9_\-:. ]+$/).test(token) && !token.includes(".."); +}; -- cgit v1.2.3-70-g09d2