@absolutejs/voice 0.0.22-beta.428 → 0.0.22-beta.429
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 +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28816,7 +28816,7 @@ var isDefined = (value) => value !== undefined;
|
|
|
28816
28816
|
var readRecentJsonFiles = async (directory, limit) => {
|
|
28817
28817
|
const files = await listRecentJsonFiles(directory, limit);
|
|
28818
28818
|
const missingPaths = new Set;
|
|
28819
|
-
const
|
|
28819
|
+
const readRecentFile = async (file) => {
|
|
28820
28820
|
try {
|
|
28821
28821
|
return await readJsonFile(file);
|
|
28822
28822
|
} catch (error) {
|
|
@@ -28826,7 +28826,8 @@ var readRecentJsonFiles = async (directory, limit) => {
|
|
|
28826
28826
|
}
|
|
28827
28827
|
throw error;
|
|
28828
28828
|
}
|
|
28829
|
-
}
|
|
28829
|
+
};
|
|
28830
|
+
const records = await Promise.all(files.map((file) => readRecentFile(file)));
|
|
28830
28831
|
if (missingPaths.size > 0) {
|
|
28831
28832
|
await writeRecentJsonFileIndex(directory, (await readRecentJsonFileIndex(directory)).filter((entry) => !missingPaths.has(entry.path)));
|
|
28832
28833
|
}
|
|
@@ -28835,8 +28836,8 @@ var readRecentJsonFiles = async (directory, limit) => {
|
|
|
28835
28836
|
return existingRecords;
|
|
28836
28837
|
}
|
|
28837
28838
|
const rebuiltFiles = (await rebuildRecentJsonFileIndex(directory)).slice(0, limit).map((entry) => entry.path);
|
|
28838
|
-
const rebuiltRecords = await Promise.all(rebuiltFiles.map((file) =>
|
|
28839
|
-
return rebuiltRecords;
|
|
28839
|
+
const rebuiltRecords = await Promise.all(rebuiltFiles.map((file) => readRecentFile(file)));
|
|
28840
|
+
return rebuiltRecords.filter(isDefined);
|
|
28840
28841
|
};
|
|
28841
28842
|
var shouldUseRecentReadWindow = (filter) => filter.readWindow === "recent" && typeof filter.limit === "number" && filter.limit >= 0;
|
|
28842
28843
|
var omitReadWindow = (filter) => {
|