mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-15 03:50:40 +00:00
13 lines
333 B
TypeScript
13 lines
333 B
TypeScript
export function resolveProcessScopedMap<T>(key: symbol): Map<string, T> {
|
|
const proc = process as NodeJS.Process & {
|
|
[symbolKey: symbol]: Map<string, T> | undefined;
|
|
};
|
|
const existing = proc[key];
|
|
if (existing) {
|
|
return existing;
|
|
}
|
|
const created = new Map<string, T>();
|
|
proc[key] = created;
|
|
return created;
|
|
}
|