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

Method feed

packages/effect/src/encoding/JsonArray.ts:263–280  ·  view source on GitHub ↗
(text: string, out: Array<unknown>)

Source from the content-addressed store, hash-verified

261 }
262
263 feed(text: string, out: Array<unknown>): void {
264 if (!this.started && text.length > 0) {
265 this.started = true
266 if (text.charCodeAt(0) === 0xFEFF) text = text.slice(1)
267 }
268 this.quote = -1
269 this.backslash = -1
270 let i = this.capture === NONE ? 0 : this.scan(text, 0, out)
271 while (i < text.length) {
272 const c = text.charCodeAt(i)
273 i = isWhitespace(c) ? i + 1 : this.step(text, i, c, out)
274 }
275 if (this.capture !== NONE) {
276 this.buffer += text.slice(Math.max(this.start - this.base, 0))
277 this.checkSize(this.buffer.length)
278 }
279 this.base += text.length
280 }
281
282 end(): void {
283 if (this.state !== END || this.capture !== NONE) {

Callers 1

decodeStringFunction · 0.95

Calls 5

scanMethod · 0.95
stepMethod · 0.95
checkSizeMethod · 0.95
sliceMethod · 0.80
isWhitespaceFunction · 0.70

Tested by

no test coverage detected