MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / findIndexById

Function findIndexById

packages/shared/src/utils.ts:143–146  ·  view source on GitHub ↗
(array: T[], id: string)

Source from the content-addressed store, hash-verified

141}
142
143export function findIndexById<T extends {id: string}>(array: T[], id: string): number {
144 for (let i = 0; i < array.length; i++) if (array[i]!.id === id) return i
145 return -1
146}
147
148export function findItemById<T extends {id: string}>(array: T[], id: string): T | undefined {
149 for (let i = 0; i < array.length; i++) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…