@vercel/fs-detectors 5.3.1 → 5.3.3

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.
@@ -60,23 +60,24 @@ class LocalFileSystemDetector extends import_filesystem.DetectorFilesystem {
60
60
  }
61
61
  async _readdir(dir) {
62
62
  const dirPath = this.getFilePath(dir);
63
- const files = await import_promises.default.readdir(dirPath);
64
- return Promise.all(
65
- files.map(async (name) => {
66
- const absPath = (0, import_path.join)(this.rootPath, dir, name);
67
- const path = (0, import_path.join)(this.getRelativeFilePath(dir), name);
68
- const stat = await import_promises.default.stat(absPath);
69
- let type;
70
- if (stat.isFile()) {
71
- type = "file";
72
- } else if (stat.isDirectory()) {
73
- type = "dir";
74
- } else {
75
- throw new Error(`Dirent was neither file nor directory: ${path}`);
76
- }
77
- return { name, path, type };
78
- })
79
- );
63
+ const entries = await import_promises.default.readdir(dirPath, { withFileTypes: true });
64
+ const result = [];
65
+ for (const entry of entries) {
66
+ let type;
67
+ if (entry.isFile()) {
68
+ type = "file";
69
+ } else if (entry.isDirectory()) {
70
+ type = "dir";
71
+ } else {
72
+ continue;
73
+ }
74
+ result.push({
75
+ name: entry.name,
76
+ path: (0, import_path.join)(this.getRelativeFilePath(dir), entry.name),
77
+ type
78
+ });
79
+ }
80
+ return result;
80
81
  }
81
82
  _chdir(name) {
82
83
  return new LocalFileSystemDetector(this.getFilePath(name));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/fs-detectors",
3
- "version": "5.3.1",
3
+ "version": "5.3.3",
4
4
  "description": "Vercel filesystem detectors",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "license": "Apache-2.0",
16
16
  "dependencies": {
17
17
  "@vercel/error-utils": "2.0.3",
18
- "@vercel/frameworks": "3.4.0",
18
+ "@vercel/frameworks": "3.5.0",
19
19
  "@vercel/routing-utils": "5.0.0",
20
20
  "glob": "8.0.3",
21
21
  "js-yaml": "4.1.0",
@@ -30,7 +30,7 @@
30
30
  "@types/minimatch": "3.0.5",
31
31
  "@types/node": "14.18.33",
32
32
  "@types/semver": "7.3.10",
33
- "@vercel/build-utils": "8.8.0",
33
+ "@vercel/build-utils": "9.1.0",
34
34
  "jest-junit": "16.0.0",
35
35
  "typescript": "4.9.5"
36
36
  },