chatccc 0.2.75 → 0.2.76
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/package.json +1 -1
- package/src/config.ts +9 -1
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -613,7 +613,15 @@ export async function getRecentDirs(): Promise<string[]> {
|
|
|
613
613
|
try {
|
|
614
614
|
const raw = await readFile(RECENT_DIRS_FILE, "utf-8");
|
|
615
615
|
const arr = JSON.parse(raw);
|
|
616
|
-
if (Array.isArray(arr))
|
|
616
|
+
if (Array.isArray(arr)) {
|
|
617
|
+
const seen = new Set<string>();
|
|
618
|
+
return arr.filter((d: unknown): d is string => {
|
|
619
|
+
if (typeof d !== "string") return false;
|
|
620
|
+
if (seen.has(d)) return false;
|
|
621
|
+
seen.add(d);
|
|
622
|
+
return true;
|
|
623
|
+
});
|
|
624
|
+
}
|
|
617
625
|
} catch { /* file doesn't exist or corrupted */ }
|
|
618
626
|
return [];
|
|
619
627
|
}
|