Comparing version 0.1.4 to 0.1.5
@@ -518,2 +518,6 @@ const _ = require("lodash"); | ||
} | ||
/** 检查指定的文件或目录,是否存在 */ | ||
static fileExists(paramFullPath) { | ||
return fs.existsSync(paramFullPath); | ||
} | ||
@@ -534,7 +538,6 @@ /** | ||
}; | ||
try { | ||
if (!fs.existsSync(paramPath)) { | ||
let pathtmp; | ||
paramPath.split(/[/\\]/).forEach((dirname)=> { //这里指用/ 或\ 都可以分隔目录 如 linux的/usr/local/services 和windows的 d:\temp\aaaa | ||
paramPath.split(/[\/\\]/).forEach((dirname)=> { //这里指用/ 或\ 都可以分隔目录 如 linux的/usr/local/services 和windows的 d:\temp\aaaa | ||
if (pathtmp) { | ||
@@ -541,0 +544,0 @@ pathtmp = path.join(pathtmp, dirname); |
{ | ||
"name": "xmcommon", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "javascript common lib for es6", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -34,2 +34,7 @@ # xmcommon | ||
## 0.1.5 | ||
- 2020-12-24 | ||
- \+ 增加fileExists判断文件或目录是否存在 | ||
- \* 修复makedirs存在的bug | ||
## 0.1.4 | ||
@@ -36,0 +41,0 @@ - 2020-08-20 |
@@ -364,2 +364,11 @@ // Type definitions for xmcommon 0.0 | ||
/** | ||
* 检查指定的文件或目录是否存在 | ||
* @param paramPath 指定的文件的目录全路径 | ||
* @return 检查结果 | ||
* - true 表示存在 | ||
* - false 表示不存在 | ||
*/ | ||
static fileExists(paramPath: string): boolean; | ||
/** | ||
@@ -366,0 +375,0 @@ * 创建目录 |
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
139636
4038
234