Skip to content

Commit

Permalink
Fix fs.watch callback type for new @types/node (#54417)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey authored May 26, 2023
1 parent d762534 commit 544d432
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ function createDirectoryWatcherSupportingRecursive({
}

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

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

0 comments on commit 544d432

Please sign in to comment.