refactor: centralize target normalization

This commit is contained in:
Peter Steinberger
2026-01-17 06:45:06 +00:00
parent 5a1ff5b9e7
commit 353d778988
10 changed files with 75 additions and 23 deletions

View File

@@ -11,10 +11,12 @@ export type DirectoryCacheKey = {
accountId?: string | null;
kind: ChannelDirectoryEntryKind;
source: "cache" | "live";
signature?: string | null;
};
export function buildDirectoryCacheKey(key: DirectoryCacheKey): string {
return `${key.channel}:${key.accountId ?? "default"}:${key.kind}:${key.source}`;
const signature = key.signature ?? "default";
return `${key.channel}:${key.accountId ?? "default"}:${key.kind}:${key.source}:${signature}`;
}
export class DirectoryCache<T> {