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

Method readQuoted

packages/effect/src/unstable/encoding/Yaml.ts:285–296  ·  view source on GitHub ↗
(quote: string)

Source from the content-addressed store, hash-verified

283 }
284
285 private readQuoted(quote: string): string {
286 const start = this.index++
287 let escaped = false
288 while (this.index < this.input.length) {
289 const character = this.input[this.index++]
290 if (quote === "\"" && escaped) escaped = false
291 else if (quote === "\"" && character === "\\") escaped = true
292 else if (quote === "'" && character === quote && this.input[this.index] === quote) this.index++
293 else if (character === quote) return this.input.slice(start, this.index)
294 }
295 this.fail("Unterminated quoted scalar")
296 }
297
298 private readUntil(stop: RegExp): string {
299 const start = this.index

Callers 2

parseValueMethod · 0.95
parseKeyMethod · 0.95

Calls 1

failMethod · 0.95

Tested by

no test coverage detected