148
*/
149
export function filterDebugEvents(events: readonly IChatDebugEvent[], options: DebugEventFilterOptions): readonly IChatDebugEvent[] {
151
>
152
>
if (options.kind) {
153
result = result.filter(e => e.kind === options.kind);
154
}
156
>
if (options.filter) {
157
result = filterDebugEventsByText(result, options.filter);
158
}
160
>
if (options.limit !== undefined && options.limit > 0 && result.length > options.limit) {
161
result = result.slice(result.length - options.limit);
162
}
164
>
return result;
165
>
}