@zwa73/utils 1.0.97 → 1.0.99
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/UtilFileTools.js +4 -1
- package/package.json +1 -1
- package/src/UtilFileTools.ts +4 -1
package/dist/UtilFileTools.js
CHANGED
|
@@ -217,7 +217,10 @@ var UtilFT;
|
|
|
217
217
|
* @returns 文件绝对路径数组
|
|
218
218
|
*/
|
|
219
219
|
function fileSearchGlob(globPattern, ignore) {
|
|
220
|
-
|
|
220
|
+
const fixedPath = typeof globPattern === "string"
|
|
221
|
+
? path.posix.normalize(globPattern)
|
|
222
|
+
: globPattern.map((p) => path.posix.normalize(p));
|
|
223
|
+
return (0, glob_1.globSync)(fixedPath, { ignore, absolute: true });
|
|
221
224
|
}
|
|
222
225
|
UtilFT.fileSearchGlob = fileSearchGlob;
|
|
223
226
|
/**
|
package/package.json
CHANGED
package/src/UtilFileTools.ts
CHANGED
|
@@ -222,7 +222,10 @@ export function fileSearchRegex(folder: string, traitRegex: string) {
|
|
|
222
222
|
* @returns 文件绝对路径数组
|
|
223
223
|
*/
|
|
224
224
|
export function fileSearchGlob(globPattern:string|string[],ignore?:string|string[]){
|
|
225
|
-
|
|
225
|
+
const fixedPath = typeof globPattern === "string"
|
|
226
|
+
? path.posix.normalize(globPattern)
|
|
227
|
+
: globPattern.map((p)=>path.posix.normalize(p));
|
|
228
|
+
return globSync(fixedPath,{ignore,absolute:true});
|
|
226
229
|
}
|
|
227
230
|
/**
|
|
228
231
|
* @deprecated 请使用 fileSearchRegex 或 fileSearchGlob
|