Socket
Socket
Sign inDemoInstall

xmcommon

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xmcommon - npm Package Compare versions

Comparing version 0.9.18 to 0.9.19

26

dist/utils.d.ts

@@ -343,2 +343,3 @@ /// <reference types="node" />

* @param paramFullPath 被检查的文件名或路径名
* @deprecated 请用fileExistsSync
* @return 检查结果

@@ -350,2 +351,27 @@ * - true 表示存在

/**
* 检查指定的文件或目录,是否存在
* @param paramFullPath 被检查的文件名或路径名
* @deprecated 请用fileExistsSync
* @return 检查结果
* - true 表示存在
* - false 表示不存在
*/
static fileExistsSync(paramFullPath: string): boolean;
/**
* 判断指定路径是不是目录
* @param paramFullPath 被检查的文件名或路径名
* @return 检查结果
* - true 表示是
* - false 表示不是
*/
static isDirSync(paramFullPath: string): boolean;
/**
* 判断指定路径是不是文件
* @param paramFullPath 被检查的文件名或路径名
* @return 检查结果
* - true 表示是
* - false 表示不是
*/
static isFileSync(paramFullPath: string): boolean;
/**
* 创建目录

@@ -352,0 +378,0 @@ * - 注意,请用绝对路径, 这里会返回具体的错误信息

@@ -625,2 +625,3 @@ "use strict";

* @param paramFullPath 被检查的文件名或路径名
* @deprecated 请用fileExistsSync
* @return 检查结果

@@ -634,2 +635,35 @@ * - true 表示存在

/**
* 检查指定的文件或目录,是否存在
* @param paramFullPath 被检查的文件名或路径名
* @deprecated 请用fileExistsSync
* @return 检查结果
* - true 表示存在
* - false 表示不存在
*/
static fileExistsSync(paramFullPath) {
return fs_1.default.existsSync(paramFullPath);
}
/**
* 判断指定路径是不是目录
* @param paramFullPath 被检查的文件名或路径名
* @return 检查结果
* - true 表示是
* - false 表示不是
*/
static isDirSync(paramFullPath) {
var _a;
return ((_a = fs_1.default.statSync(paramFullPath)) === null || _a === void 0 ? void 0 : _a.isDirectory()) || false;
}
/**
* 判断指定路径是不是文件
* @param paramFullPath 被检查的文件名或路径名
* @return 检查结果
* - true 表示是
* - false 表示不是
*/
static isFileSync(paramFullPath) {
var _a;
return ((_a = fs_1.default.statSync(paramFullPath)) === null || _a === void 0 ? void 0 : _a.isFile()) || false;
}
/**
* 创建目录

@@ -636,0 +670,0 @@ * - 注意,请用绝对路径, 这里会返回具体的错误信息

@@ -660,2 +660,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

* @param paramFullPath 被检查的文件名或路径名
* @deprecated 请用fileExistsSync
* @return 检查结果

@@ -668,4 +669,36 @@ * - true 表示存在

}
/**
* 检查指定的文件或目录,是否存在
* @param paramFullPath 被检查的文件名或路径名
* @deprecated 请用fileExistsSync
* @return 检查结果
* - true 表示存在
* - false 表示不存在
*/
public static fileExistsSync(paramFullPath: string): boolean {
return fs.existsSync(paramFullPath);
}
/**
* 判断指定路径是不是目录
* @param paramFullPath 被检查的文件名或路径名
* @return 检查结果
* - true 表示是
* - false 表示不是
*/
public static isDirSync(paramFullPath: string): boolean {
return fs.statSync(paramFullPath)?.isDirectory() || false;
}
/**
* 判断指定路径是不是文件
* @param paramFullPath 被检查的文件名或路径名
* @return 检查结果
* - true 表示是
* - false 表示不是
*/
public static isFileSync(paramFullPath: string): boolean {
return fs.statSync(paramFullPath)?.isFile() || false;
}
/**
* 创建目录

@@ -672,0 +705,0 @@ * - 注意,请用绝对路径, 这里会返回具体的错误信息

8

package.json
{
"name": "xmcommon",
"version": "0.9.18",
"version": "0.9.19",
"description": "一个基于javascript的常用功能扩展库! 使用TypeScript重构!",

@@ -42,5 +42,5 @@ "main": "./dist/index.js",

"@types/node": "^8.10.66",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"eslint": "^8.6.0",
"@typescript-eslint/eslint-plugin": "^5.12.1",
"@typescript-eslint/parser": "^5.12.1",
"eslint": "^8.9.0",
"eslint-config-google": "^0.14.0",

@@ -47,0 +47,0 @@ "prettier": "^2.5.1",

@@ -39,3 +39,6 @@ # xmcommon

# 版本变更说明
## 0.9.19
- 2022-2-23
- \+ utils增加isDirSync, isFileSync方法
- \* 更新依赖库的版本
## 0.9.18

@@ -42,0 +45,0 @@ - 2022-01-23

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc