diff --git a/js/files_test.ts b/js/files_test.ts index f26e9113f01795..9014e7b831b8f6 100644 --- a/js/files_test.ts +++ b/js/files_test.ts @@ -61,7 +61,7 @@ testPerm({ write: true }, async function createFile() { f.close(); // TODO: test different modes - await deno.remove(tempDir, {recursive: true}); + await deno.remove(tempDir, { recursive: true }); }); testPerm({ write: true }, async function openModeWrite() { @@ -95,7 +95,7 @@ testPerm({ write: true }, async function openModeWrite() { file.close(); const fileSize = deno.statSync(filename).len; assertEqual(fileSize, 0); - await deno.remove(tempDir, {recursive: true}); + await deno.remove(tempDir, { recursive: true }); }); testPerm({ write: true }, async function openModeWriteRead() { @@ -124,5 +124,5 @@ testPerm({ write: true }, async function openModeWriteRead() { // assertEqual(result.nread, 13); // file.close(); - await deno.remove(tempDir, {recursive: true}); + await deno.remove(tempDir, { recursive: true }); }); diff --git a/js/remove.ts b/js/remove.ts index bf94bdc53d6fbc..d9f69399daf80c 100644 --- a/js/remove.ts +++ b/js/remove.ts @@ -29,7 +29,8 @@ export function removeSync(path: string, options: RemoveOption = {}): void { */ export async function remove( path: string, - options: RemoveOption = {}): Promise { + options: RemoveOption = {} +): Promise { await dispatch.sendAsync(...req(path, options)); } diff --git a/js/remove_test.ts b/js/remove_test.ts index a1f2cbbc7fbab2..df4fe72d6fdbca 100644 --- a/js/remove_test.ts +++ b/js/remove_test.ts @@ -92,7 +92,7 @@ testPerm({ write: true }, function removeAllSyncDirSuccess() { deno.mkdirSync(path); let pathInfo = deno.statSync(path); assert(pathInfo.isDirectory()); // check exist first - deno.removeSync(path, {recursive: true}); // remove + deno.removeSync(path, { recursive: true }); // remove // We then check again after remove let err; try { @@ -112,7 +112,7 @@ testPerm({ write: true }, function removeAllSyncDirSuccess() { assert(pathInfo.isDirectory()); // check exist first const subPathInfo = deno.statSync(subPath); assert(subPathInfo.isDirectory()); // check exist first - deno.removeSync(path, {recursive: true}); // remove + deno.removeSync(path, { recursive: true }); // remove // We then check parent directory again after remove try { deno.statSync(path); @@ -132,7 +132,7 @@ testPerm({ write: true }, function removeAllSyncFileSuccess() { deno.writeFileSync(filename, data, 0o666); const fileInfo = deno.statSync(filename); assert(fileInfo.isFile()); // check exist first - deno.removeSync(filename, {recursive: true}); // remove + deno.removeSync(filename, { recursive: true }); // remove // We then check again after remove let err; try { @@ -150,7 +150,7 @@ testPerm({ write: true }, function removeAllSyncFail() { let err; try { // Non-existent - deno.removeSync("/baddir", {recursive: true}); + deno.removeSync("/baddir", { recursive: true }); } catch (e) { err = e; } @@ -161,7 +161,7 @@ testPerm({ write: true }, function removeAllSyncFail() { testPerm({ write: false }, function removeAllSyncPerm() { let err; try { - deno.removeSync("/baddir", {recursive: true}); + deno.removeSync("/baddir", { recursive: true }); } catch (e) { err = e; } @@ -258,7 +258,7 @@ testPerm({ write: true }, async function removeAllDirSuccess() { deno.mkdirSync(path); let pathInfo = deno.statSync(path); assert(pathInfo.isDirectory()); // check exist first - await deno.remove(path, {recursive: true}); // remove + await deno.remove(path, { recursive: true }); // remove // We then check again after remove let err; try { @@ -278,7 +278,7 @@ testPerm({ write: true }, async function removeAllDirSuccess() { assert(pathInfo.isDirectory()); // check exist first const subPathInfo = deno.statSync(subPath); assert(subPathInfo.isDirectory()); // check exist first - await deno.remove(path, {recursive: true}); // remove + await deno.remove(path, { recursive: true }); // remove // We then check parent directory again after remove try { deno.statSync(path); @@ -298,7 +298,7 @@ testPerm({ write: true }, async function removeAllFileSuccess() { deno.writeFileSync(filename, data, 0o666); const fileInfo = deno.statSync(filename); assert(fileInfo.isFile()); // check exist first - await deno.remove(filename, {recursive: true}); // remove + await deno.remove(filename, { recursive: true }); // remove // We then check again after remove let err; try { @@ -316,7 +316,7 @@ testPerm({ write: true }, async function removeAllFail() { let err; try { // Non-existent - await deno.remove("/baddir", {recursive: true}); + await deno.remove("/baddir", { recursive: true }); } catch (e) { err = e; } @@ -327,7 +327,7 @@ testPerm({ write: true }, async function removeAllFail() { testPerm({ write: false }, async function removeAllPerm() { let err; try { - await deno.remove("/baddir", {recursive: true}); + await deno.remove("/baddir", { recursive: true }); } catch (e) { err = e; }