chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -28,7 +28,9 @@ export class DirectoryCache<T> {
get(key: string, cfg: OpenClawConfig): T | undefined {
this.resetIfConfigChanged(cfg);
const entry = this.cache.get(key);
if (!entry) return undefined;
if (!entry) {
return undefined;
}
if (Date.now() - entry.fetchedAt > this.ttlMs) {
this.cache.delete(key);
return undefined;
@@ -43,13 +45,17 @@ export class DirectoryCache<T> {
clearMatching(match: (key: string) => boolean): void {
for (const key of this.cache.keys()) {
if (match(key)) this.cache.delete(key);
if (match(key)) {
this.cache.delete(key);
}
}
}
clear(cfg?: OpenClawConfig): void {
this.cache.clear();
if (cfg) this.lastConfigRef = cfg;
if (cfg) {
this.lastConfigRef = cfg;
}
}
private resetIfConfigChanged(cfg: OpenClawConfig): void {