diff --git a/fs/expand_glob.ts b/fs/expand_glob.ts index f32359c302b0..024ebb8eb42f 100644 --- a/fs/expand_glob.ts +++ b/fs/expand_glob.ts @@ -127,7 +127,7 @@ export async function* expandGlob( let fixedRoot = isGlobAbsolute ? winRoot !== undefined ? winRoot : "/" : absRoot; - while (segments.length > 0 && !isGlob(segments[0])) { + while (segments.length > 0 && !isGlob(segments[0]!)) { const seg = segments.shift(); assert(seg !== undefined); fixedRoot = joinGlobs([fixedRoot, seg], globOptions); @@ -253,7 +253,7 @@ export function* expandGlobSync( let fixedRoot = isGlobAbsolute ? winRoot !== undefined ? winRoot : "/" : absRoot; - while (segments.length > 0 && !isGlob(segments[0])) { + while (segments.length > 0 && !isGlob(segments[0]!)) { const seg = segments.shift(); assert(seg !== undefined); fixedRoot = joinGlobs([fixedRoot, seg], globOptions); diff --git a/fs/move_test.ts b/fs/move_test.ts index 60dc4a15d7c8..3b2632d833c4 100644 --- a/fs/move_test.ts +++ b/fs/move_test.ts @@ -388,7 +388,7 @@ Deno.test("move() accepts overwrite option set to true for file content", async [file, url], [url, file], [url, url], - ]; + ] as const; for (const p of pairs) { const src = p[0]; @@ -415,7 +415,7 @@ Deno.test("move() accepts overwrite option set to true for directories", async f [dir, url], [url, dir], [url, url], - ]; + ] as const; for (const p of pairs) { const src = p[0]; @@ -446,7 +446,7 @@ Deno.test("moveSync() accepts overwrite option set to true for file content", fu [file, url], [url, file], [url, url], - ]; + ] as const; for (const p of pairs) { const src = p[0]; @@ -473,7 +473,7 @@ Deno.test("move() accepts overwrite option set to true for directories", functio [dir, url], [url, dir], [url, url], - ]; + ] as const; for (const p of pairs) { const src = p[0]; diff --git a/fs/testdata/empty_dir.ts b/fs/testdata/empty_dir.ts index f8fcc1cebee6..105b536642d4 100644 --- a/fs/testdata/empty_dir.ts +++ b/fs/testdata/empty_dir.ts @@ -1,6 +1,6 @@ import { emptyDir } from "../empty_dir.ts"; -emptyDir(Deno.args[0]) +emptyDir(Deno.args[0]!) .then(() => { Deno.stdout.write(new TextEncoder().encode("success")); }) diff --git a/fs/testdata/empty_dir_sync.ts b/fs/testdata/empty_dir_sync.ts index c26092cc01ad..29a3b86d97a1 100644 --- a/fs/testdata/empty_dir_sync.ts +++ b/fs/testdata/empty_dir_sync.ts @@ -1,7 +1,7 @@ import { emptyDirSync } from "../empty_dir.ts"; try { - emptyDirSync(Deno.args[0]); + emptyDirSync(Deno.args[0]!); Deno.stdout.write(new TextEncoder().encode("success")); } catch (err) { Deno.stdout.write(