From 7aa11b7a8abacf81dec20fff21216df35d333756 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 27 Jul 2025 18:50:33 -0700 Subject: Pulls in pengueno from npm --- u/process/validate_identifier.ts | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 u/process/validate_identifier.ts (limited to 'u/process/validate_identifier.ts') diff --git a/u/process/validate_identifier.ts b/u/process/validate_identifier.ts deleted file mode 100644 index 1ff3791..0000000 --- a/u/process/validate_identifier.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Either, type IEither } from '@emprespresso/pengueno'; - -export const validateIdentifier = (token: string) => { - return /^[a-zA-Z0-9_\-:. \/]+$/.test(token) && !token.includes('..'); -}; - -// ensure {@param obj} is a Record with stuff that won't -// have the potential for shell injection, just to be super safe. -type InvalidEntry = [K, T]; -export const validateExecutionEntries = ( - obj: Record, -): IEither>, Record> => { - const invalidEntries = >>( - Object.entries(obj).filter((e) => !e.every((x) => typeof x === 'string' && validateIdentifier(x))) - ); - if (invalidEntries.length > 0) return Either.left(invalidEntries); - return Either.right(>obj); -}; -- cgit v1.2.3-70-g09d2