diff options
author | Yusuke Sakurai <kerokerokerop@gmail.com> | 2020-02-07 16:23:38 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 02:23:38 -0500 |
commit | c2986891f6aac87cec98232735945af756e6643f (patch) | |
tree | 716dc739f438bf740fa960b87fc022d569090802 /std/fs/walk.ts | |
parent | ea6179f7dce89416f1586ee18c2f437e68eabd38 (diff) |
remove non-null assertion operator from std (part1) (#3900)
Diffstat (limited to 'std/fs/walk.ts')
-rw-r--r-- | std/fs/walk.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/std/fs/walk.ts b/std/fs/walk.ts index 1655b63ab..108eebc46 100644 --- a/std/fs/walk.ts +++ b/std/fs/walk.ts @@ -1,7 +1,7 @@ // Documentation and interface for walk were adapted from Go // https://golang.org/pkg/path/filepath/#Walk // Copyright 2009 The Go Authors. All rights reserved. BSD license. -import { unimplemented } from "../testing/asserts.ts"; +import { unimplemented, assert } from "../testing/asserts.ts"; import { join } from "../path/mod.ts"; const { readDir, readDirSync, stat, statSync } = Deno; type FileInfo = Deno.FileInfo; @@ -90,7 +90,8 @@ export async function* walk( } } - const filename = join(root, info.name!); + assert(info.name != null); + const filename = join(root, info.name); if (info.isFile()) { if (includeFiles && include(filename, exts, match, skip)) { @@ -142,7 +143,8 @@ export function* walkSync( } } - const filename = join(root, info.name!); + assert(info.name != null); + const filename = join(root, info.name); if (info.isFile()) { if (includeFiles && include(filename, exts, match, skip)) { |