summaryrefslogtreecommitdiff
path: root/u/process/validate_identifier.ts
diff options
context:
space:
mode:
authorElizabeth <lizhunt@amazon.com>2025-05-28 15:05:38 -0700
committerElizabeth <lizhunt@amazon.com>2025-05-28 15:05:38 -0700
commit3005cc83e605fb89b079cf0e6fd0ec95cd27b30e (patch)
tree992c5933f2ec4a75e32469ddd772c61dbcb2e2fd /u/process/validate_identifier.ts
parente3cf820b07e282221502cf2f116c9780b7375e0e (diff)
downloadci-3005cc83e605fb89b079cf0e6fd0ec95cd27b30e.tar.gz
ci-3005cc83e605fb89b079cf0e6fd0ec95cd27b30e.zip
Run prettier, add zed settings
Diffstat (limited to 'u/process/validate_identifier.ts')
-rw-r--r--u/process/validate_identifier.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/u/process/validate_identifier.ts b/u/process/validate_identifier.ts
index 32952a6..4e93728 100644
--- a/u/process/validate_identifier.ts
+++ b/u/process/validate_identifier.ts
@@ -1,7 +1,7 @@
import { Either, type IEither } from "@emprespresso/pengueno";
export const validateIdentifier = (token: string) => {
- return (/^[a-zA-Z0-9_\-:. \/]+$/).test(token) && !token.includes("..");
+ return /^[a-zA-Z0-9_\-:. \/]+$/.test(token) && !token.includes("..");
};
// ensure {@param obj} is a Record<string, string> with stuff that won't
@@ -12,13 +12,12 @@ export const validateExecutionEntries = <
K extends symbol | number | string = symbol | number | string,
>(
obj: Record<K, T>,
-): IEither<
- Array<InvalidEntry<K, T>>,
- Record<string, string>
-> => {
- const invalidEntries = <Array<InvalidEntry<K, T>>> Object.entries(obj).filter(
- (e) => !e.every((x) => typeof x === "string" && validateIdentifier(x)),
+): IEither<Array<InvalidEntry<K, T>>, Record<string, string>> => {
+ const invalidEntries = <Array<InvalidEntry<K, T>>>(
+ Object.entries(obj).filter(
+ (e) => !e.every((x) => typeof x === "string" && validateIdentifier(x)),
+ )
);
if (invalidEntries.length > 0) return Either.left(invalidEntries);
- return Either.right(<Record<string, string>> obj);
+ return Either.right(<Record<string, string>>obj);
};