summaryrefslogtreecommitdiff
path: root/std/fs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-02-24 15:48:35 -0500
committerGitHub <noreply@github.com>2020-02-24 15:48:35 -0500
commite1687c0a4616e90d4bbde42b13a0356a7f6a1e7d (patch)
tree9aff6a2281d87a2487f8ed98b0b3f0a8733d04b5 /std/fs
parentdb597055958a9dbc9c8e633e01d9229b55d1d6ef (diff)
rename Deno.Err -> Deno.errors (#4093)
Diffstat (limited to 'std/fs')
-rw-r--r--std/fs/copy.ts4
-rw-r--r--std/fs/empty_dir.ts4
-rw-r--r--std/fs/ensure_dir.ts4
-rw-r--r--std/fs/ensure_file.ts4
-rw-r--r--std/fs/exists.ts4
-rw-r--r--std/fs/expand_glob.ts2
-rw-r--r--std/fs/walk_test.ts2
7 files changed, 12 insertions, 12 deletions
diff --git a/std/fs/copy.ts b/std/fs/copy.ts
index ec51784c6..d19c120f7 100644
--- a/std/fs/copy.ts
+++ b/std/fs/copy.ts
@@ -29,7 +29,7 @@ async function ensureValidCopy(
try {
destStat = await Deno.lstat(dest);
} catch (err) {
- if (err instanceof Deno.Err.NotFound) {
+ if (err instanceof Deno.errors.NotFound) {
return;
}
throw err;
@@ -57,7 +57,7 @@ function ensureValidCopySync(
try {
destStat = Deno.lstatSync(dest);
} catch (err) {
- if (err instanceof Deno.Err.NotFound) {
+ if (err instanceof Deno.errors.NotFound) {
return;
}
throw err;
diff --git a/std/fs/empty_dir.ts b/std/fs/empty_dir.ts
index 0ac5e6420..a848e90a1 100644
--- a/std/fs/empty_dir.ts
+++ b/std/fs/empty_dir.ts
@@ -20,7 +20,7 @@ export async function emptyDir(dir: string): Promise<void> {
}
}
} catch (err) {
- if (!(err instanceof Deno.Err.NotFound)) {
+ if (!(err instanceof Deno.errors.NotFound)) {
throw err;
}
@@ -49,7 +49,7 @@ export function emptyDirSync(dir: string): void {
}
}
} catch (err) {
- if (!(err instanceof Deno.Err.NotFound)) {
+ if (!(err instanceof Deno.errors.NotFound)) {
throw err;
}
// if not exist. then create it
diff --git a/std/fs/ensure_dir.ts b/std/fs/ensure_dir.ts
index b6cc3150a..a74261c61 100644
--- a/std/fs/ensure_dir.ts
+++ b/std/fs/ensure_dir.ts
@@ -16,7 +16,7 @@ export async function ensureDir(dir: string): Promise<void> {
);
}
} catch (err) {
- if (err instanceof Deno.Err.NotFound) {
+ if (err instanceof Deno.errors.NotFound) {
// if dir not exists. then create it.
await mkdir(dir, { recursive: true });
return;
@@ -39,7 +39,7 @@ export function ensureDirSync(dir: string): void {
);
}
} catch (err) {
- if (err instanceof Deno.Err.NotFound) {
+ if (err instanceof Deno.errors.NotFound) {
// if dir not exists. then create it.
mkdirSync(dir, { recursive: true });
return;
diff --git a/std/fs/ensure_file.ts b/std/fs/ensure_file.ts
index be824b7ba..77732164a 100644
--- a/std/fs/ensure_file.ts
+++ b/std/fs/ensure_file.ts
@@ -23,7 +23,7 @@ export async function ensureFile(filePath: string): Promise<void> {
}
} catch (err) {
// if file not exists
- if (err instanceof Deno.Err.NotFound) {
+ if (err instanceof Deno.errors.NotFound) {
// ensure dir exists
await ensureDir(path.dirname(filePath));
// create file
@@ -54,7 +54,7 @@ export function ensureFileSync(filePath: string): void {
}
} catch (err) {
// if file not exists
- if (err instanceof Deno.Err.NotFound) {
+ if (err instanceof Deno.errors.NotFound) {
// ensure dir exists
ensureDirSync(path.dirname(filePath));
// create file
diff --git a/std/fs/exists.ts b/std/fs/exists.ts
index 2cd415173..ae64cb1f3 100644
--- a/std/fs/exists.ts
+++ b/std/fs/exists.ts
@@ -7,7 +7,7 @@ export async function exists(filePath: string): Promise<boolean> {
return lstat(filePath)
.then((): boolean => true)
.catch((err: Error): boolean => {
- if (err instanceof Deno.Err.NotFound) {
+ if (err instanceof Deno.errors.NotFound) {
return false;
}
@@ -23,7 +23,7 @@ export function existsSync(filePath: string): boolean {
lstatSync(filePath);
return true;
} catch (err) {
- if (err instanceof Deno.Err.NotFound) {
+ if (err instanceof Deno.errors.NotFound) {
return false;
}
throw err;
diff --git a/std/fs/expand_glob.ts b/std/fs/expand_glob.ts
index 61fca9602..c6653eda1 100644
--- a/std/fs/expand_glob.ts
+++ b/std/fs/expand_glob.ts
@@ -43,7 +43,7 @@ function split(path: string): SplitPath {
}
function throwUnlessNotFound(error: Error): void {
- if (!(error instanceof Deno.Err.NotFound)) {
+ if (!(error instanceof Deno.errors.NotFound)) {
throw error;
}
}
diff --git a/std/fs/walk_test.ts b/std/fs/walk_test.ts
index f99f82eb5..caf806262 100644
--- a/std/fs/walk_test.ts
+++ b/std/fs/walk_test.ts
@@ -235,7 +235,7 @@ testWalk(
async function nonexistentRoot(): Promise<void> {
await assertThrowsAsync(async () => {
await walkArray("nonexistent");
- }, Deno.Err.NotFound);
+ }, Deno.errors.NotFound);
}
);