Skip to content

Commit

Permalink
Correct type of pino's stream parameter (#1874)
Browse files Browse the repository at this point in the history
  • Loading branch information
quisido authored Jan 27, 2024
1 parent 89fc326 commit fdd0fd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pino.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ declare function pino<CustomLevels extends string = never>(optionsOrStream?: Log
* relative protocol is enabled. Default: process.stdout
* @returns a new logger instance.
*/
declare function pino<CustomLevels extends string = never>(options: LoggerOptions<CustomLevels>, stream: DestinationStream): Logger<CustomLevels>;
declare function pino<CustomLevels extends string = never>(options: LoggerOptions<CustomLevels>, stream?: DestinationStream | undefined): Logger<CustomLevels>;


// Pass through all the top-level exports, allows `import {version} from "pino"`
Expand Down
2 changes: 2 additions & 0 deletions test/types/pino.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ pino({
},
});

pino({}, undefined);

pino({ base: null });
if ("pino" in log) console.log(`pino version: ${log.pino}`);

Expand Down

0 comments on commit fdd0fd9

Please sign in to comment.