From cc1f46ce22cb71073c771e486133491ced63c74a Mon Sep 17 00:00:00 2001 From: Maximilien Mellen Date: Tue, 11 Feb 2020 14:47:33 +0100 Subject: [PATCH] squash! Update codebase to support TypeScript strict mode Post-rebase fixes for strict mode --- std/fs/copy.ts | 2 ++ std/io/bufio.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/std/fs/copy.ts b/std/fs/copy.ts index 62e6f59e541d2d..86fac78dff7493 100644 --- a/std/fs/copy.ts +++ b/std/fs/copy.ts @@ -85,6 +85,8 @@ async function copyFile( await Deno.copyFile(src, dest); if (options.preserveTimestamps) { const statInfo = await Deno.stat(src); + assert(statInfo.accessed != null, `statInfo.accessed is unavailable`); + assert(statInfo.modified != null, `statInfo.modified is unavailable`); await Deno.utime(dest, statInfo.accessed, statInfo.modified); } } diff --git a/std/io/bufio.ts b/std/io/bufio.ts index f721022f30caad..ba573d0e5d822c 100644 --- a/std/io/bufio.ts +++ b/std/io/bufio.ts @@ -311,7 +311,7 @@ export class BufReader implements Reader { */ async readSlice(delim: number): Promise { let s = 0; // search start index - let slice: Uint8Array; + let slice: Uint8Array | undefined; while (true) { // Search buffer.