mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-05 04:12:51 +00:00
fix(shared): default non-finite string sample limits
This commit is contained in:
@@ -7,7 +7,8 @@ export function summarizeStringEntries(params: {
|
||||
if (entries.length === 0) {
|
||||
return params.emptyText ?? "";
|
||||
}
|
||||
const limit = Math.max(1, Math.floor(params.limit ?? 6));
|
||||
const rawLimit = params.limit ?? 6;
|
||||
const limit = Number.isFinite(rawLimit) ? Math.max(1, Math.floor(rawLimit)) : 6;
|
||||
const sample = entries.slice(0, limit);
|
||||
const suffix = entries.length > sample.length ? ` (+${entries.length - sample.length})` : "";
|
||||
return `${sample.join(", ")}${suffix}`;
|
||||
|
||||
Reference in New Issue
Block a user