Skip to content

Commit b4dc6d2

Browse files
committed
Fix the error definition
1 parent 0485474 commit b4dc6d2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/main.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,19 @@ export interface DotenvConfigOptions {
9090
}
9191

9292
export interface DotenvConfigOutput {
93-
error?: Error;
93+
error?: DotenvError;
9494
parsed?: DotenvParseOutput;
9595
}
9696

97+
type DotenvError = Error & {
98+
code:
99+
| 'MISSING_DATA'
100+
| 'INVALID_DOTENV_KEY'
101+
| 'NOT_FOUND_DOTENV_ENVIRONMENT'
102+
| 'DECRYPTION_FAILED'
103+
| 'OBJECT_REQUIRED';
104+
}
105+
97106
export interface DotenvPopulateOptions {
98107
/**
99108
* Default: `false`

0 commit comments

Comments
 (0)