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

Function whileArray

packages/shared/src/utils.ts:163–174  ·  view source on GitHub ↗
(
    toCheck: T[],
    callback: (item: T, toCheck: T[]) => U | undefined,
)

Source from the content-addressed store, hash-verified

161}
162
163export function whileArray<T, U>(
164 toCheck: T[],
165 callback: (item: T, toCheck: T[]) => U | undefined,
166): U | undefined {
167 let index = 0
168 let current: T = toCheck[index++]!
169 while (current) {
170 const result = callback(current, toCheck)
171 if (result !== undefined) return result
172 current = toCheck[index++]!
173 }
174}
175
176export type ToDyscriminatedUnion<
177 // eslint-disable-next-line @typescript-eslint/no-empty-object-type

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…