@vercel/build-utils 5.8.3 → 5.9.0

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/fs/glob.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import vanillaGlob_ from 'glob';
2
2
  import FileFsRef from '../file-fs-ref';
3
- export declare type GlobOptions = vanillaGlob_.IOptions;
3
+ export interface GlobOptions extends vanillaGlob_.IOptions {
4
+ includeDirectories?: boolean;
5
+ }
4
6
  export default function glob(pattern: string, opts: GlobOptions | string, mountpoint?: string): Promise<Record<string, FileFsRef>>;
package/dist/fs/glob.js CHANGED
@@ -55,16 +55,18 @@ async function glob(pattern, opts, mountpoint) {
55
55
  }
56
56
  }
57
57
  // Add empty directory entries
58
- for (const relativePath of dirs) {
59
- if (dirsWithEntries.has(relativePath))
60
- continue;
61
- let finalPath = relativePath;
62
- if (mountpoint) {
63
- finalPath = path_1.default.join(mountpoint, finalPath);
58
+ if (options.includeDirectories) {
59
+ for (const relativePath of dirs) {
60
+ if (dirsWithEntries.has(relativePath))
61
+ continue;
62
+ let finalPath = relativePath;
63
+ if (mountpoint) {
64
+ finalPath = path_1.default.join(mountpoint, finalPath);
65
+ }
66
+ const fsPath = normalize_path_1.normalizePath(path_1.default.join(options.cwd, relativePath));
67
+ const stat = statCache[fsPath];
68
+ results[finalPath] = new file_fs_ref_1.default({ mode: stat.mode, fsPath });
64
69
  }
65
- const fsPath = normalize_path_1.normalizePath(path_1.default.join(options.cwd, relativePath));
66
- const stat = statCache[fsPath];
67
- results[finalPath] = new file_fs_ref_1.default({ mode: stat.mode, fsPath });
68
70
  }
69
71
  return results;
70
72
  }
package/dist/index.js CHANGED
@@ -30762,16 +30762,18 @@ async function glob(pattern, opts, mountpoint) {
30762
30762
  }
30763
30763
  }
30764
30764
  // Add empty directory entries
30765
- for (const relativePath of dirs) {
30766
- if (dirsWithEntries.has(relativePath))
30767
- continue;
30768
- let finalPath = relativePath;
30769
- if (mountpoint) {
30770
- finalPath = path_1.default.join(mountpoint, finalPath);
30765
+ if (options.includeDirectories) {
30766
+ for (const relativePath of dirs) {
30767
+ if (dirsWithEntries.has(relativePath))
30768
+ continue;
30769
+ let finalPath = relativePath;
30770
+ if (mountpoint) {
30771
+ finalPath = path_1.default.join(mountpoint, finalPath);
30772
+ }
30773
+ const fsPath = normalize_path_1.normalizePath(path_1.default.join(options.cwd, relativePath));
30774
+ const stat = statCache[fsPath];
30775
+ results[finalPath] = new file_fs_ref_1.default({ mode: stat.mode, fsPath });
30771
30776
  }
30772
- const fsPath = normalize_path_1.normalizePath(path_1.default.join(options.cwd, relativePath));
30773
- const stat = statCache[fsPath];
30774
- results[finalPath] = new file_fs_ref_1.default({ mode: stat.mode, fsPath });
30775
30777
  }
30776
30778
  return results;
30777
30779
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "5.8.3",
3
+ "version": "5.9.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -51,5 +51,5 @@
51
51
  "typescript": "4.3.4",
52
52
  "yazl": "2.5.1"
53
53
  },
54
- "gitHead": "b5cdc82a1cca4d0b3369490f8a19fd8f8478fe94"
54
+ "gitHead": "4ccdcde463560dc44da89edf52523419fc56ab62"
55
55
  }