diff options
author | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-12 09:40:12 -0700 |
---|---|---|
committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-12 09:54:58 -0700 |
commit | 723fa00cb14513eb1a517728d4464c4f148a29cc (patch) | |
tree | d32e2f725397d41b3ad7f886d61c16458dde5b37 /utils/validate_identifier.ts | |
parent | 30729a0cf707d9022bae0a7baaba77379dc31fd5 (diff) | |
download | ci-723fa00cb14513eb1a517728d4464c4f148a29cc.tar.gz ci-723fa00cb14513eb1a517728d4464c4f148a29cc.zip |
The big refactor
Diffstat (limited to 'utils/validate_identifier.ts')
-rw-r--r-- | utils/validate_identifier.ts | 8 |
1 files changed, 8 insertions, 0 deletions
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<string, string>, +): Array<[string, string]> => { + return Object.entries(obj).filter((e) => + !e.every((x) => typeof x === "string" && validateIdentifier(x)) + ); +}; |