mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:01:22 +00:00
refactor: centralize target normalization
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user