(options: DecodeOptions | undefined, bytes: boolean)
| 973 | ) |
| 974 | |
| 975 | const 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 | |
| 985 | const textEncoder = new TextEncoder() |
| 986 |
no test coverage detected