@absolutejs/voice 0.0.22-beta.533 → 0.0.22-beta.534
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 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -43477,7 +43477,13 @@ var listRecentJsonFiles = async (directory, limit) => {
|
|
|
43477
43477
|
return (await rebuildRecentJsonFileIndex(directory)).slice(0, limit).map((entry) => entry.path);
|
|
43478
43478
|
};
|
|
43479
43479
|
var recentJsonFileIndexPath = (directory) => join4(directory, ".recent-index");
|
|
43480
|
-
var
|
|
43480
|
+
var lastRecentIndexTimestamp = 0;
|
|
43481
|
+
var nextRecentIndexTimestamp = () => {
|
|
43482
|
+
const now = Date.now();
|
|
43483
|
+
lastRecentIndexTimestamp = now > lastRecentIndexTimestamp ? now : lastRecentIndexTimestamp + 1;
|
|
43484
|
+
return lastRecentIndexTimestamp;
|
|
43485
|
+
};
|
|
43486
|
+
var sortRecentJsonFileIndexEntries = (entries) => entries.sort((left, right) => right.updatedAt - left.updatedAt || (left.path < right.path ? 1 : left.path > right.path ? -1 : 0));
|
|
43481
43487
|
var readRecentJsonFileIndex = async (directory) => {
|
|
43482
43488
|
try {
|
|
43483
43489
|
const payload = await readJsonFile(recentJsonFileIndexPath(directory)) ?? { files: [] };
|
|
@@ -43524,7 +43530,7 @@ var updateRecentJsonFileIndex = async (directory, path) => {
|
|
|
43524
43530
|
const files = (await readRecentJsonFileIndex(directory)).filter((entry) => entry.path !== path);
|
|
43525
43531
|
files.push({
|
|
43526
43532
|
path,
|
|
43527
|
-
updatedAt:
|
|
43533
|
+
updatedAt: nextRecentIndexTimestamp()
|
|
43528
43534
|
});
|
|
43529
43535
|
await writeRecentJsonFileIndex(directory, files);
|
|
43530
43536
|
};
|