mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #7470 from Yaojian/master
fixes #7469 uncaughtException: stream.write is not a function
This commit is contained in:
@@ -23,7 +23,9 @@ morgan('combined', {
|
||||
buffer: true,
|
||||
immediate: true,
|
||||
skip: function (req, res) { return res.statusCode < 400 },
|
||||
stream: (str: string) => {
|
||||
console.log(str);
|
||||
stream: {
|
||||
write: (str: string) => {
|
||||
console.log(str);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+8
-1
@@ -12,6 +12,13 @@ declare module "morgan" {
|
||||
|
||||
export function token<T>(name: string, callback: (req: express.Request, res: express.Response) => T): express.RequestHandler;
|
||||
|
||||
export interface StreamOptions {
|
||||
/**
|
||||
* Output stream for writing log lines
|
||||
*/
|
||||
write: (str: string) => void;
|
||||
}
|
||||
|
||||
/***
|
||||
* Morgan accepts these properties in the options object.
|
||||
*/
|
||||
@@ -36,7 +43,7 @@ declare module "morgan" {
|
||||
* Output stream for writing log lines, defaults to process.stdout.
|
||||
* @param str
|
||||
*/
|
||||
stream?: (str: string) => void;
|
||||
stream?: StreamOptions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user