Skip to content

Commit fdd0fd9

Browse files
authored
Correct type of pino's stream parameter (#1874)
1 parent 89fc326 commit fdd0fd9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pino.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ declare function pino<CustomLevels extends string = never>(optionsOrStream?: Log
799799
* relative protocol is enabled. Default: process.stdout
800800
* @returns a new logger instance.
801801
*/
802-
declare function pino<CustomLevels extends string = never>(options: LoggerOptions<CustomLevels>, stream: DestinationStream): Logger<CustomLevels>;
802+
declare function pino<CustomLevels extends string = never>(options: LoggerOptions<CustomLevels>, stream?: DestinationStream | undefined): Logger<CustomLevels>;
803803

804804

805805
// Pass through all the top-level exports, allows `import {version} from "pino"`

test/types/pino.test-d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ pino({
107107
},
108108
});
109109

110+
pino({}, undefined);
111+
110112
pino({ base: null });
111113
if ("pino" in log) console.log(`pino version: ${log.pino}`);
112114

0 commit comments

Comments
 (0)