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
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue