MCPcopy Create free account
hub / github.com/Effect-TS/effect / begin

Method begin

packages/effect/src/encoding/JsonArray.ts:384–394  ·  view source on GitHub ↗
(mode: number, text: string, i: number, out: Array<unknown>)

Source from the content-addressed store, hash-verified

382
383 // Starts capturing the value that begins at `i`.
384 begin(mode: number, text: string, i: number, out: Array<unknown>): number {
385 const c = text.charCodeAt(i)
386 this.capture = mode
387 this.start = this.base + i
388 this.inString = c === QUOTE
389 this.escape = false
390 this.depth = c === LBRACKET || c === LBRACE ? 1 : 0
391 this.scalar = !this.inString && this.depth === 0
392 if (this.depth > this.config.maxDepth) this.failDepth()
393 return this.scan(text, i + 1, out)
394 }
395
396 // Continues the captured value from `i`, completing it if it ends in this
397 // chunk. Returns the index after the value, or the chunk length.

Callers 1

stepMethod · 0.95

Calls 2

failDepthMethod · 0.95
scanMethod · 0.95

Tested by

no test coverage detected