@zwa73/dev-utils 1.0.46 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Command/MapPath.js
CHANGED
@@ -29,7 +29,7 @@ const CmdMapPath = (program) => program
|
|
29
29
|
const duplicateHandling = options.duplicateHandling;
|
30
30
|
const basePath = process.cwd();
|
31
31
|
// 遍历当前目录下的所有文件
|
32
|
-
const filePaths = utils_1.UtilFT.fileSearchRegex(basePath, regex.source, { relative: options.recursive
|
32
|
+
const filePaths = utils_1.UtilFT.fileSearchRegex(basePath, regex.source, { relative: options.recursive })
|
33
33
|
.map((filePath) => pathe_1.default.relative(basePath, filePath))
|
34
34
|
.filter((filePath) => excludeRegex ? (!excludeRegex.test(filePath)) : true);
|
35
35
|
//对单个路径映射
|
package/dist/Command/ScanDups.js
CHANGED
@@ -30,7 +30,6 @@ const CmdScanDups = (program) => program
|
|
30
30
|
const basePath = process.cwd();
|
31
31
|
const pList = utils_1.UtilFT.fileSearchRegex(basePath, regex.source, {
|
32
32
|
relative: options.recursive,
|
33
|
-
style: "posix",
|
34
33
|
}).map(async (filePath) => ({ filePath, hash: await calculateHash(filePath) }));
|
35
34
|
const hashMap = (await Promise.all(pList)).reduce((obj, cur) => {
|
36
35
|
obj[cur.hash] = (obj[cur.hash] ?? []).concat(cur.filePath);
|
package/dist/UtilDevTool.js
CHANGED
@@ -143,7 +143,7 @@ var UtilDT;
|
|
143
143
|
const basePath = loc?.filePath;
|
144
144
|
return opt?.filePath
|
145
145
|
? opt.glob
|
146
|
-
? utils_1.UtilFT.fileSearchGlob(process.cwd(), opt.filePath
|
146
|
+
? utils_1.UtilFT.fileSearchGlob(process.cwd(), opt.filePath)
|
147
147
|
: typeof opt?.filePath === "string"
|
148
148
|
? [opt?.filePath]
|
149
149
|
: opt?.filePath.map((filepath) => filepath)
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zwa73/dev-utils",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.48",
|
4
4
|
"description": "编译与调试工具",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"author": "zwa73",
|
17
17
|
"license": "ISC",
|
18
18
|
"dependencies": {
|
19
|
-
"@zwa73/utils": "^1.0.
|
19
|
+
"@zwa73/utils": "^1.0.122",
|
20
20
|
"commander": "^11.1.0",
|
21
21
|
"pathe": "^1.1.2",
|
22
22
|
"ts-node": "^10.9.2",
|
package/src/Command/MapPath.ts
CHANGED
@@ -27,7 +27,7 @@ export const CmdMapPath = (program: Command) => program
|
|
27
27
|
const duplicateHandling = options.duplicateHandling as DupMethod;
|
28
28
|
const basePath = process.cwd();
|
29
29
|
// 遍历当前目录下的所有文件
|
30
|
-
const filePaths = UtilFT.fileSearchRegex(basePath, regex.source,{relative:options.recursive
|
30
|
+
const filePaths = UtilFT.fileSearchRegex(basePath, regex.source,{relative:options.recursive})
|
31
31
|
.map((filePath)=>path.relative(basePath, filePath))
|
32
32
|
.filter((filePath)=>excludeRegex ? (!excludeRegex.test(filePath)) : true);
|
33
33
|
|
package/src/Command/ScanDups.ts
CHANGED
@@ -28,7 +28,6 @@ export const CmdScanDups = (program: Command) => program
|
|
28
28
|
const basePath = process.cwd();
|
29
29
|
const pList = UtilFT.fileSearchRegex(basePath, regex.source, {
|
30
30
|
relative: options.recursive,
|
31
|
-
style: "posix",
|
32
31
|
}).map(async (filePath) => ({ filePath, hash: await calculateHash(filePath) }));
|
33
32
|
|
34
33
|
const hashMap = (await Promise.all(pList)).reduce((obj,cur)=>{
|
package/src/UtilDevTool.ts
CHANGED
@@ -158,7 +158,7 @@ const parseMacroPaths = (opt?:MacroOpt)=>{
|
|
158
158
|
const basePath = loc?.filePath!;
|
159
159
|
return opt?.filePath
|
160
160
|
? opt.glob
|
161
|
-
? UtilFT.fileSearchGlob(process.cwd(),opt.filePath
|
161
|
+
? UtilFT.fileSearchGlob(process.cwd(),opt.filePath)
|
162
162
|
: typeof opt?.filePath==="string"
|
163
163
|
? [opt?.filePath]
|
164
164
|
: opt?.filePath.map((filepath)=>filepath)
|