Skip to content

Commit 544d432

Browse files
authored
Fix fs.watch callback type for new @types/node (#54417)
1 parent d762534 commit 544d432

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/compiler/sys.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ function createDirectoryWatcherSupportingRecursive({
812812
}
813813

814814
/** @internal */
815-
export type FsWatchCallback = (eventName: "rename" | "change", relativeFileName: string | undefined, modifiedTime?: Date) => void;
815+
export type FsWatchCallback = (eventName: "rename" | "change", relativeFileName: string | undefined | null, modifiedTime?: Date) => void;
816816
/** @internal */
817817
export type FsWatch = (fileOrDirectory: string, entryKind: FileSystemEntryKind, callback: FsWatchCallback, recursive: boolean, fallbackPollingInterval: PollingInterval, fallbackOptions: WatchOptions | undefined) => FileWatcher;
818818
/** @internal */
@@ -1205,7 +1205,7 @@ export function createSystemWatchFunctions({
12051205
}
12061206
}
12071207

1208-
function callbackChangingToMissingFileSystemEntry(event: "rename" | "change", relativeName: string | undefined) {
1208+
function callbackChangingToMissingFileSystemEntry(event: "rename" | "change", relativeName: string | undefined | null) {
12091209
// In some scenarios, file save operation fires event with fileName.ext~ instead of fileName.ext
12101210
// To ensure we see the file going missing and coming back up (file delete and then recreated)
12111211
// and watches being updated correctly we are calling back with fileName.ext as well as fileName.ext~

0 commit comments

Comments
 (0)