From e856bc029aaeac14de009db7e9cfd516e021be9a Mon Sep 17 00:00:00 2001 From: kingwl Date: Thu, 14 May 2020 21:41:44 +0000 Subject: [PATCH] Cherry-pick PR #38525 into release-3.9 Component commits: 19624faea7 Fix build type error --- src/harness/vfsUtil.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/harness/vfsUtil.ts b/src/harness/vfsUtil.ts index 76475b00360b2..88fc73ebca9be 100644 --- a/src/harness/vfsUtil.ts +++ b/src/harness/vfsUtil.ts @@ -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");