@absolutejs/voice 0.0.22-beta.424 → 0.0.22-beta.425
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 +23 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28753,7 +28753,29 @@ var listRecentJsonFiles = async (directory, limit) => {
|
|
|
28753
28753
|
}
|
|
28754
28754
|
const indexedFiles = await readRecentJsonFileIndex(directory);
|
|
28755
28755
|
if (indexedFiles.length >= limit) {
|
|
28756
|
-
|
|
28756
|
+
const existingFiles = [];
|
|
28757
|
+
const missingPaths = new Set;
|
|
28758
|
+
for (const entry of indexedFiles) {
|
|
28759
|
+
try {
|
|
28760
|
+
await stat(entry.path);
|
|
28761
|
+
existingFiles.push(entry);
|
|
28762
|
+
if (existingFiles.length === limit) {
|
|
28763
|
+
break;
|
|
28764
|
+
}
|
|
28765
|
+
} catch (error) {
|
|
28766
|
+
if (error.code === "ENOENT") {
|
|
28767
|
+
missingPaths.add(entry.path);
|
|
28768
|
+
continue;
|
|
28769
|
+
}
|
|
28770
|
+
throw error;
|
|
28771
|
+
}
|
|
28772
|
+
}
|
|
28773
|
+
if (missingPaths.size > 0) {
|
|
28774
|
+
await writeRecentJsonFileIndex(directory, indexedFiles.filter((entry) => !missingPaths.has(entry.path)));
|
|
28775
|
+
}
|
|
28776
|
+
if (existingFiles.length === limit) {
|
|
28777
|
+
return existingFiles.map((entry) => entry.path);
|
|
28778
|
+
}
|
|
28757
28779
|
}
|
|
28758
28780
|
return (await rebuildRecentJsonFileIndex(directory)).slice(0, limit).map((entry) => entry.path);
|
|
28759
28781
|
};
|