refactor: remove unneeded ErrorKinds (#3936)

This commit is contained in:
Bartek Iwańczuk 2020-02-21 10:36:13 -05:00 committed by GitHub
parent d9efb8c02a
commit dd8a109481
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 553 additions and 620 deletions

View file

@ -3,8 +3,6 @@ import { globrex } from "./globrex.ts";
import { join, normalize } from "./mod.ts";
import { assert } from "../testing/asserts.ts";
const { DenoError, ErrorKind } = Deno;
export interface GlobOptions {
extended?: boolean;
globstar?: boolean;
@ -91,10 +89,7 @@ export function normalizeGlob(
{ globstar = false }: GlobOptions = {}
): string {
if (!!glob.match(/\0/g)) {
throw new DenoError(
ErrorKind.InvalidPath,
`Glob contains invalid characters: "${glob}"`
);
throw new Error(`Glob contains invalid characters: "${glob}"`);
}
if (!globstar) {
return normalize(glob);