mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-22 13:21:07 -05:00
Remove unnecessary trailing resume messages
This commit is contained in:
17
src/utils/array-helpers.ts
Normal file
17
src/utils/array-helpers.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Returns the index of the last element in the array where predicate is true, and -1
|
||||
* otherwise.
|
||||
* @param array The source array to search in
|
||||
* @param predicate find calls predicate once for each element of the array, in descending
|
||||
* order, until it finds one where predicate returns true. If such an element is found,
|
||||
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
||||
*/
|
||||
export function findLastIndex<T>(array: Array<T>, predicate: (value: T, index: number, obj: T[]) => boolean): number {
|
||||
let l = array.length
|
||||
while (l--) {
|
||||
if (predicate(array[l], l, array)) {
|
||||
return l
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
@@ -2,3 +2,4 @@ export * from "./getNonce"
|
||||
export * from "./getUri"
|
||||
export * from "./process-images"
|
||||
export * from "./export-markdown"
|
||||
export * from "./array-helpers"
|
||||
|
||||
Reference in New Issue
Block a user