Skip to content

Commit

Permalink
Cherry-pick PR microsoft#38525 into release-3.9
Browse files Browse the repository at this point in the history
Component commits:
19624fa Fix build type error
  • Loading branch information
Kingwl authored and typescript-bot committed May 14, 2020
1 parent 3d5f66b commit e856bc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/harness/vfsUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,14 +649,14 @@ namespace vfs {
*
* NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
*/
public readFileSync(path: string, encoding: string): string;
public readFileSync(path: string, encoding: BufferEncoding): string;
/**
* Read from a file.
*
* NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
*/
public readFileSync(path: string, encoding?: string | null): string | Buffer;
public readFileSync(path: string, encoding: string | null = null) { // eslint-disable-line no-null/no-null
public readFileSync(path: string, encoding?: BufferEncoding | null): string | Buffer;
public readFileSync(path: string, encoding: BufferEncoding | null = null) { // eslint-disable-line no-null/no-null
const { node } = this._walk(this._resolve(path));
if (!node) throw createIOError("ENOENT");
if (isDirectory(node)) throw createIOError("EISDIR");
Expand Down

0 comments on commit e856bc0

Please sign in to comment.