modality-kit 0.17.7 → 0.17.8
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/index.js +8 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15605,9 +15605,9 @@ function recursiveScanForFiles(baseDir, options) {
|
|
|
15605
15605
|
searchInSubfolders = false
|
|
15606
15606
|
} = options;
|
|
15607
15607
|
const extensionSet = new Set(fileExtensions);
|
|
15608
|
+
const errors3 = [];
|
|
15608
15609
|
function scanDirectory(dir, relativePath = "", isSearchingForTarget = true) {
|
|
15609
15610
|
const entries = readdirSync(dir);
|
|
15610
|
-
const errors3 = [];
|
|
15611
15611
|
for (const entry of entries) {
|
|
15612
15612
|
try {
|
|
15613
15613
|
if (excludePatterns.some((pattern) => entry.startsWith(pattern))) {
|
|
@@ -15615,7 +15615,9 @@ function recursiveScanForFiles(baseDir, options) {
|
|
|
15615
15615
|
}
|
|
15616
15616
|
const fullPath = join(dir, entry);
|
|
15617
15617
|
const relPath = relativePath ? `${relativePath}/${entry}` : entry;
|
|
15618
|
-
const isDirectory = statSync(fullPath
|
|
15618
|
+
const isDirectory = statSync(fullPath, {
|
|
15619
|
+
throwIfNoEntry: false
|
|
15620
|
+
})?.isDirectory();
|
|
15619
15621
|
if (isSearchingForTarget) {
|
|
15620
15622
|
if (isDirectory) {
|
|
15621
15623
|
scanDirectory(fullPath, relPath, entry !== targetFolderName);
|
|
@@ -15628,14 +15630,14 @@ function recursiveScanForFiles(baseDir, options) {
|
|
|
15628
15630
|
files.push({ filename: relPath, fullPath });
|
|
15629
15631
|
}
|
|
15630
15632
|
} catch (e) {
|
|
15631
|
-
errors3.push(e);
|
|
15633
|
+
errors3.push({ dir: e });
|
|
15632
15634
|
}
|
|
15633
15635
|
}
|
|
15634
|
-
if (errors3.length > 0) {
|
|
15635
|
-
throw new Error(`Errors occurred while scanning directory "${dir}": ${errors3.map((err) => err.message).join("; ")}`);
|
|
15636
|
-
}
|
|
15637
15636
|
}
|
|
15638
15637
|
scanDirectory(baseDir, "", true);
|
|
15638
|
+
if (errors3.length > 0) {
|
|
15639
|
+
throw new Error(`Error scanning directory: ${JSON.stringify(errors3)}`);
|
|
15640
|
+
}
|
|
15639
15641
|
return files.sort((a, b) => a.filename.localeCompare(b.filename));
|
|
15640
15642
|
}
|
|
15641
15643
|
export {
|
package/package.json
CHANGED