MCPcopy Index your code
hub / github.com/Effect-TS/effect / forIndex

Function forIndex

packages/effect/src/internal/stm/tArray.ts:208–219  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

206 from: number
207) => {
208 const forIndex = (index: number): STM.STM<Option.Option<number>, E, R> =>
209 index < self.chunk.length
210 ? pipe(
211 tRef.get(self.chunk[index]),
212 core.flatMap(predicate),
213 core.flatMap((bool) =>
214 bool ?
215 core.succeed(Option.some(index)) :
216 forIndex(index + 1)
217 )
218 )
219 : stm.succeedNone
220 return from < 0
221 ? stm.succeedNone
222 : forIndex(from)

Callers 1

tArray.tsFile · 0.85

Calls 2

getMethod · 0.65
pipeFunction · 0.50

Tested by

no test coverage detected