File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,10 @@ util.format();
7171
7272util . formatWithOptions ( { colors : true } , "See object %O" , { foo : 42 } ) ;
7373
74- util . parseEnv ( "HELLO=world\nHELLO=oh my\n" ) ;
74+ {
75+ const dotenv = util . parseEnv ( "HELLO=world\nHELLO=oh my\n" ) ;
76+ dotenv . HELLO ; // $ExpectType string | undefined
77+ }
7578
7679console . log ( util . styleText ( "red" , "Error! Error!" ) ) ;
7780console . log (
Original file line number Diff line number Diff line change @@ -1411,7 +1411,7 @@ declare module "util" {
14111411 * @param content The raw contents of a `.env` file.
14121412 * @since v20.12.0
14131413 */
1414- export function parseEnv ( content : string ) : object ;
1414+ export function parseEnv ( content : string ) : NodeJS . Dict < string > ;
14151415 // https://nodejs.org/docs/latest/api/util.html#foreground-colors
14161416 type ForegroundColors =
14171417 | "black"
Original file line number Diff line number Diff line change @@ -62,7 +62,10 @@ util.format();
6262
6363util . formatWithOptions ( { colors : true } , "See object %O" , { foo : 42 } ) ;
6464
65- util . parseEnv ( "HELLO=world\nHELLO=oh my\n" ) ;
65+ {
66+ const dotenv = util . parseEnv ( "HELLO=world\nHELLO=oh my\n" ) ;
67+ dotenv . HELLO ; // $ExpectType string | undefined
68+ }
6669
6770console . log ( util . styleText ( "red" , "Error! Error!" ) ) ;
6871console . log (
Original file line number Diff line number Diff line change @@ -1186,7 +1186,7 @@ declare module "util" {
11861186 * @param content The raw contents of a `.env` file.
11871187 * @since v20.12.0
11881188 */
1189- export function parseEnv ( content : string ) : object ;
1189+ export function parseEnv ( content : string ) : NodeJS . Dict < string > ;
11901190 // https://nodejs.org/docs/latest/api/util.html#foreground-colors
11911191 type ForegroundColors =
11921192 | "black"
You can’t perform that action at this time.
0 commit comments