From 723fa00cb14513eb1a517728d4464c4f148a29cc Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Mon, 12 May 2025 09:40:12 -0700 Subject: The big refactor --- utils/validate_identifier.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'utils/validate_identifier.ts') diff --git a/utils/validate_identifier.ts b/utils/validate_identifier.ts index 0c9242c..c204497 100644 --- a/utils/validate_identifier.ts +++ b/utils/validate_identifier.ts @@ -1,3 +1,11 @@ export const validateIdentifier = (token: string) => { return (/^[a-zA-Z0-9_\-:. \/]+$/).test(token) && !token.includes(".."); }; + +export const invalidExecutionEntriesOf = ( + obj: Record, +): Array<[string, string]> => { + return Object.entries(obj).filter((e) => + !e.every((x) => typeof x === "string" && validateIdentifier(x)) + ); +}; -- cgit v1.2.3-70-g09d2