@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.
@@ -217,7 +217,10 @@ var UtilFT;
217
217
  * @returns 文件绝对路径数组
218
218
  */
219
219
  function fileSearchGlob(globPattern, ignore) {
220
- return (0, glob_1.globSync)(globPattern, { ignore, absolute: true });
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.97",
3
+ "version": "1.0.99",
4
4
  "description": "my utils",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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
- return globSync(globPattern,{ignore,absolute:true});
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