mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
refactor: remove unneeded ErrorKinds (#3936)
This commit is contained in:
parent
d9efb8c02a
commit
dd8a109481
66 changed files with 553 additions and 620 deletions
|
@ -10,9 +10,7 @@ import {
|
|||
} from "../path/mod.ts";
|
||||
import { WalkInfo, walk, walkSync } from "./walk.ts";
|
||||
import { assert } from "../testing/asserts.ts";
|
||||
const { ErrorKind, cwd, stat, statSync } = Deno;
|
||||
type ErrorKind = Deno.ErrorKind;
|
||||
type DenoError = Deno.DenoError<ErrorKind>;
|
||||
const { cwd, stat, statSync } = Deno;
|
||||
type FileInfo = Deno.FileInfo;
|
||||
|
||||
export interface ExpandGlobOptions extends GlobOptions {
|
||||
|
@ -45,7 +43,7 @@ function split(path: string): SplitPath {
|
|||
}
|
||||
|
||||
function throwUnlessNotFound(error: Error): void {
|
||||
if ((error as DenoError).kind != ErrorKind.NotFound) {
|
||||
if (!(error instanceof Deno.Err.NotFound)) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue