appolo-utils
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -13,2 +13,6 @@ "use strict"; | ||
static async removeDir(dirPath, removeSelf = true) { | ||
let isExists = await exists(dirPath); | ||
if (!isExists) { | ||
return; | ||
} | ||
let status = await stat(dirPath); | ||
@@ -35,2 +39,6 @@ if (!status.isDirectory()) { | ||
static async removeFile(filePath) { | ||
let isExists = await exists(filePath); | ||
if (!isExists) { | ||
return; | ||
} | ||
let status = await stat(filePath); | ||
@@ -46,5 +54,6 @@ if (status.isDirectory()) { | ||
let isExists = await exists(dirPath); | ||
if (!isExists) { | ||
await mkdir(dirPath); | ||
if (isExists) { | ||
return; | ||
} | ||
await mkdir(dirPath); | ||
} | ||
@@ -51,0 +60,0 @@ static async reCreateDir(dirPath) { |
@@ -14,3 +14,8 @@ import * as fs from "fs"; | ||
let isExists = await exists(dirPath); | ||
if (!isExists) { | ||
return; | ||
} | ||
let status = await stat(dirPath); | ||
@@ -47,2 +52,9 @@ | ||
public static async removeFile(filePath: string): Promise<void> { | ||
let isExists = await exists(filePath); | ||
if (!isExists) { | ||
return; | ||
} | ||
let status = await stat(filePath); | ||
@@ -63,5 +75,7 @@ | ||
if (!isExists) { | ||
await mkdir(dirPath); | ||
if (isExists) { | ||
return; | ||
} | ||
await mkdir(dirPath); | ||
} | ||
@@ -68,0 +82,0 @@ |
@@ -17,3 +17,3 @@ { | ||
"main": "./index.js", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"license": "MIT", | ||
@@ -20,0 +20,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35562
693