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

Method parseValue

packages/effect/src/unstable/encoding/Yaml.ts:209–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

207 }
208
209 private parseValue(): unknown {
210 this.skipWhitespace()
211 const character = this.peek()
212 if (character === "[") return this.parseSequence()
213 if (character === "{") return this.parseMapping()
214 if (character === "\"" || character === "'") return parseScalar(this.readQuoted(character))
215 if (character === "*") {
216 this.index++
217 const name = this.readUntil(/[,\]}\s]/)
218 if (!this.anchors.has(name)) this.fail(`Unknown alias '*${name}'`)
219 return this.anchors.get(name)
220 }
221 return parseScalar(this.readUntil(/[,\]}]/).trim())
222 }
223
224 private parseSequence(): Array<unknown> {
225 this.expect("[")

Callers 3

parseMethod · 0.95
parseSequenceMethod · 0.95
parseMappingMethod · 0.95

Calls 10

skipWhitespaceMethod · 0.95
peekMethod · 0.95
parseSequenceMethod · 0.95
parseMappingMethod · 0.95
readQuotedMethod · 0.95
readUntilMethod · 0.95
failMethod · 0.95
parseScalarFunction · 0.85
getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected