@aiot-toolkit/shared-utils
Advanced tools
Comparing version 2.0.2-beta.4 to 2.0.2-beta.5
@@ -16,2 +16,3 @@ /// <reference types="node" /> | ||
static calcDataDigest(buffer: Buffer): Buffer; | ||
static calcImageDigest(filePath: string): string; | ||
/** | ||
@@ -18,0 +19,0 @@ * 从开发者项目的 node_module 中加载指定依赖; |
@@ -28,2 +28,7 @@ "use strict"; | ||
} | ||
static calcImageDigest(filePath) { | ||
const data = fs_1.default.readFileSync(filePath); | ||
const hash = crypto_1.default.createHash('md5').update(data); | ||
return hash.digest('hex'); | ||
} | ||
/** | ||
@@ -30,0 +35,0 @@ * 从开发者项目的 node_module 中加载指定依赖; |
@@ -25,3 +25,3 @@ /** | ||
*/ | ||
static arrayTostring(arr: any[], styleTransform?: boolean): string; | ||
static arrayToString(arr: any[], styleTransform?: boolean): string; | ||
/** | ||
@@ -28,0 +28,0 @@ * 对象转字符串 |
@@ -37,3 +37,3 @@ "use strict"; | ||
*/ | ||
static arrayTostring(arr, styleTransform = false) { | ||
static arrayToString(arr, styleTransform = false) { | ||
if (Array.isArray(arr)) { | ||
@@ -52,3 +52,3 @@ if (arr.length <= 0) { | ||
if (Array.isArray(item)) { | ||
valueStr = StringUtil.arrayTostring(item, styleTransform); | ||
valueStr = StringUtil.arrayToString(item, styleTransform); | ||
} | ||
@@ -88,3 +88,3 @@ else { | ||
if (Array.isArray(value)) { | ||
valueStr = StringUtil.arrayTostring(value, styleTransform); | ||
valueStr = StringUtil.arrayToString(value, styleTransform); | ||
} | ||
@@ -91,0 +91,0 @@ else { |
{ | ||
"name": "@aiot-toolkit/shared-utils", | ||
"version": "2.0.2-beta.4", | ||
"version": "2.0.2-beta.5", | ||
"description": "The common method functions of the aiot-toolkit.", | ||
@@ -26,5 +26,6 @@ "homepage": "", | ||
"devDependencies": { | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/qrcode-terminal": "^0.12.0" | ||
}, | ||
"gitHead": "656add8e64d8101b9f3886957c5b9ae23e2e854f" | ||
"gitHead": "8c18753992c453c6569a3125378e75fbf4760a1f" | ||
} |
30907
970
2