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

Method push

packages/effect/src/encoding/Xml.ts:2195–2206  ·  view source on GitHub ↗
(chunk: string)

Source from the content-addressed store, hash-verified

2193 }
2194
2195 push(chunk: string): void {
2196 if (this.surrogate !== "") {
2197 chunk = this.surrogate + chunk
2198 this.surrogate = ""
2199 }
2200 const last = chunk.charCodeAt(chunk.length - 1)
2201 if (last >= 0xD800 && last <= 0xDBFF) {
2202 this.surrogate = chunk.slice(-1)
2203 chunk = chunk.slice(0, -1)
2204 }
2205 this.parser.feed(chunk)
2206 }
2207
2208 end(): void {
2209 // An unpaired high surrogate fails as an invalid character

Callers

nothing calls this directly

Calls 2

sliceMethod · 0.80
feedMethod · 0.65

Tested by

no test coverage detected