MCPcopy
hub / github.com/TanStack/router / findLast

Function findLast

packages/router-core/src/utils.ts:507–516  ·  view source on GitHub ↗
(
  array: ReadonlyArray<T>,
  predicate: (item: T) => boolean,
)

Source from the content-addressed store, hash-verified

505}
506
507export function findLast<T>(
508 array: ReadonlyArray<T>,
509 predicate: (item: T) => boolean,
510): T | undefined {
511 for (let i = array.length - 1; i >= 0; i--) {
512 const item = array[i]!
513 if (predicate(item)) return item
514 }
515 return undefined
516}
517
518/**
519 * Remove control characters that can cause open redirect vulnerabilities.

Callers 1

buildMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected