From 9fb63b71118c3f442ed96d94a3b827603f497cb3 Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 30 Mar 2017 00:25:44 -0400 Subject: [PATCH] Removed optional parameter from lstat The optional flag on the callback version of lstat causes tsc to complain about using as promise. It always assumes to first variant which does not return a Promise. You can see the `stat` and `fstat` have it removed. I am very confident this is the intended behaviour, and the optional flag is a copy-paste typo. --- types/mz/fs.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/mz/fs.d.ts b/types/mz/fs.d.ts index 975850c3ab..ff7222acee 100644 --- a/types/mz/fs.d.ts +++ b/types/mz/fs.d.ts @@ -142,7 +142,7 @@ export function stat(path: string | Buffer): Promise; * `lstat()` is identical to `stat()`, except that if path is a symbolic link, then the link itself * is stat-ed, not the file that it refers to. */ -export function lstat(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, stats: fs.Stats) => any): void; +export function lstat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => any): void; /** * Asynchronous `lstat(2)`. @@ -502,4 +502,4 @@ export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoExcept * @param path The path to access. * @param mode An optional integer that specifies the accessibility checks to be performed. */ -export function access(path: string, mode?: number): Promise; \ No newline at end of file +export function access(path: string, mode?: number): Promise;