Skip to content

Commit

Permalink
docs: 📝 Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pklaschka committed Oct 29, 2024
1 parent b173ecb commit b4b0383
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ export class ConfigFileReadError extends Error {
this.cause = cause;
}
}

/**
* An error that gets thrown by {@link initVariable} when the environment variable
* cannot be parsed using the Zod schema.
*/
export class ConfigParseError extends Error {}

/**
Expand Down Expand Up @@ -225,7 +230,10 @@ function logger() {
return getLogger("@wuespace/envar");
}

type ZodSchemaCompat = {
/**
* A type that is compatible with Zod schemas.
*/
export type ZodSchemaCompat = {
safeParse: (value: unknown) => { error: Error | null };
isOptional: () => boolean;
};

0 comments on commit b4b0383

Please sign in to comment.