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

Function makeParser

packages/effect/src/encoding/Xml.ts:975–983  ·  view source on GitHub ↗
(options: DecodeOptions | undefined, bytes: boolean)

Source from the content-addressed store, hash-verified

973 )
974
975const makeParser = (options: DecodeOptions | undefined, bytes: boolean): () => Parser => {
976 const maxTokenSize = checkLimit("maxTokenSize", options?.maxTokenSize, defaultMaxTokenSize)
977 const maxDepth = checkLimit("maxDepth", options?.maxDepth, defaultMaxDepth)
978 const namespaces = options?.namespaces
979 if (namespaces !== undefined && namespaces !== "strict") {
980 throw new Error(`Xml: namespaces must be "strict", got ${JSON.stringify(namespaces)}`)
981 }
982 return () => new Parser(maxTokenSize, maxDepth, bytes, options?.positions === true, namespaces === "strict")
983}
984
985const textEncoder = new TextEncoder()
986

Callers 2

decodeStringFunction · 0.70
decodeFunction · 0.70

Calls 1

checkLimitFunction · 0.85

Tested by

no test coverage detected