[multer] Allow null in DiskStorageOptions.destination.callback first parameter (#16617)

* `null` is used [in the docs](https://github.com/expressjs/multer#diskstorage)
* `null` was allowed in `callback` for brother interface element `filename` as part of PR https://github.com/DefinitelyTyped/DefinitelyTyped/pull/14112/files , but `destination` wasn't updated at this time.
This commit is contained in:
Ronan Jouchet
2017-06-02 09:42:09 -04:00
committed by Andy
parent 5bdcc082d4
commit 0abba50bae

View File

@@ -46,7 +46,7 @@ declare namespace multer {
interface DiskStorageOptions {
/** A function used to determine within which folder the uploaded files should be stored. Defaults to the system's default temporary directory. */
destination?: string | ((req: Express.Request, file: Express.Multer.File, callback: (error: Error, destination: string) => void) => void);
destination?: string | ((req: Express.Request, file: Express.Multer.File, callback: (error: Error | null, destination: string) => void) => void);
/** A function used to determine what the file should be named inside the folder. Defaults to a random name with no file extension. */
filename?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error | null, filename: string) => void) => void;
}
@@ -113,4 +113,4 @@ declare global {
}
}
}
}
}