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

Method scanScalar

packages/effect/src/encoding/JsonArray.ts:418–424  ·  view source on GitHub ↗
(text: string, i: number)

Source from the content-addressed store, hash-verified

416
417 // A scalar ends at the first delimiter, which `JSON.parse` then validates.
418 scanScalar(text: string, i: number): number {
419 for (; i < text.length; i++) {
420 const c = text.charCodeAt(i)
421 if (isWhitespace(c) || c === COMMA || c === RBRACKET || c === RBRACE) return i
422 }
423 return -1
424 }
425
426 // Tracks only string, escape and nesting state; `JSON.parse` validates the
427 // rest. Returns the index after the value, or -1.

Callers 1

scanMethod · 0.95

Calls 1

isWhitespaceFunction · 0.70

Tested by

no test coverage detected