mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 20:05:46 -06:00
fix(types): narrow admission ticket session keys with a type guard (#120441)
This commit is contained in:
committed by
GitHub
parent
1f15bc92f9
commit
df038b9f80
@@ -16,7 +16,13 @@ const tails = resolveGlobalMap<string, Promise<void>>(Symbol.for("openclaw.reply
|
||||
export function reserveReplyAdmissionTicket(
|
||||
sessionKeys: Iterable<string | undefined>,
|
||||
): ReplyAdmissionTicket | undefined {
|
||||
const keys = [...new Set([...sessionKeys].map(normalizeOptionalString).filter(Boolean))].sort();
|
||||
const keys = [
|
||||
...new Set(
|
||||
[...sessionKeys]
|
||||
.map(normalizeOptionalString)
|
||||
.filter((key): key is string => typeof key === "string"),
|
||||
),
|
||||
].sort();
|
||||
if (keys.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user