summaryrefslogtreecommitdiff
path: root/u/process/env.ts
diff options
context:
space:
mode:
Diffstat (limited to 'u/process/env.ts')
-rw-r--r--u/process/env.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/u/process/env.ts b/u/process/env.ts
index 470cb39..5ba4189 100644
--- a/u/process/env.ts
+++ b/u/process/env.ts
@@ -1,10 +1,13 @@
import { Either, type IEither } from "@emprespresso/pengueno";
export const getRequiredEnv = <V extends string>(name: V): IEither<Error, V> =>
- Either.fromFailable<Error, V | undefined>(() => Deno.env.get(name) as V | undefined) // could throw when no permission.
+ Either.fromFailable<Error, V | undefined>(
+ () => Deno.env.get(name) as V | undefined,
+ ) // could throw when no permission.
.flatMap(
- (v) => (v && Either.right(v)) ||
- Either.left(new Error(`environment variable "${name}" is required D:`))
+ (v) =>
+ (v && Either.right(v)) ||
+ Either.left(new Error(`environment variable "${name}" is required D:`)),
);
type ObjectFromList<T extends ReadonlyArray<string>, V = string> = {