summaryrefslogtreecommitdiff
path: root/std/path/glob.ts
diff options
context:
space:
mode:
authorYusuke Sakurai <kerokerokerop@gmail.com>2020-02-07 16:23:38 +0900
committerGitHub <noreply@github.com>2020-02-07 02:23:38 -0500
commitc2986891f6aac87cec98232735945af756e6643f (patch)
tree716dc739f438bf740fa960b87fc022d569090802 /std/path/glob.ts
parentea6179f7dce89416f1586ee18c2f437e68eabd38 (diff)
remove non-null assertion operator from std (part1) (#3900)
Diffstat (limited to 'std/path/glob.ts')
-rw-r--r--std/path/glob.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/std/path/glob.ts b/std/path/glob.ts
index daee22f98..a079f448f 100644
--- a/std/path/glob.ts
+++ b/std/path/glob.ts
@@ -1,6 +1,8 @@
import { SEP, SEP_PATTERN } from "./constants.ts";
import { globrex } from "./globrex.ts";
import { join, normalize } from "./mod.ts";
+import { assert } from "../testing/asserts.ts";
+
const { DenoError, ErrorKind } = Deno;
export interface GlobOptions {
@@ -46,7 +48,8 @@ export function globToRegExp(
strict: false,
filepath: true
});
- return result.path!.regex;
+ assert(result.path != null);
+ return result.path.regex;
}
/** Test whether the given string is a glob */