Skip to content

Commit 8da5442

Browse files
committed
feat: add doc strings
1 parent 1010c6b commit 8da5442

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

apps/web/src/environments/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import Configuration from './config.json';
22
import { z } from 'zod';
3+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4+
import type { ZodError } from 'zod';
35

46
const Config = z.object({
57
ONPATIENT_CLIENT_ID: z.string().optional(),
@@ -21,6 +23,11 @@ const Config = z.object({
2123

2224
type Config = z.infer<typeof Config>;
2325

26+
/**
27+
* Get the configuration object
28+
* @returns Config object
29+
* @throws {ZodError} Error if the configuration is invalid
30+
*/
2431
export const getConfig = (): Config => {
2532
try {
2633
return Config.parse(Configuration);
@@ -36,10 +43,20 @@ const OnPatientConfig = z.object({
3643
ONPATIENT_CLIENT_ID: z.string(),
3744
});
3845

46+
/**
47+
* Get the OnPatient configuration object
48+
* @returns OnPatientConfig object
49+
* @throws {ZodError} Error if the configuration is invalid
50+
*/
3951
export const getOnPatientConfig = () => {
4052
return OnPatientConfig.parse(Configuration);
4153
};
4254

55+
/**
56+
* Get the configured redirect URI
57+
* @returns The configured redirect URI
58+
* @throws {ZodError} Error if the configuration is invalid
59+
*/
4360
export const getRedirectUri = () => {
4461
try {
4562
const config = Config.parse(Configuration);

0 commit comments

Comments
 (0)