MCPcopy Create free account
hub / github.com/denoland/std / collectEvents

Function collectEvents

xml/_parser_test.ts:129–137  ·  view source on GitHub ↗

Helper to collect all events from parsing an XML string synchronously.

(xml: string, options?: ParseStreamOptions)

Source from the content-addressed store, hash-verified

127
128/** Helper to collect all events from parsing an XML string synchronously. */
129function collectEvents(xml: string, options?: ParseStreamOptions): XmlEvent[] {
130 const tokenizer = new XmlTokenizer();
131 const { events, callbacks } = createEventCollector();
132 const parser = new XmlEventParser(callbacks, options);
133 tokenizer.process(xml, parser);
134 tokenizer.finalize(parser);
135 parser.finalize();
136 return events;
137}
138
139// =============================================================================
140// Namespace Prefix Parsing (Parser-specific)

Callers 1

_parser_test.tsFile · 0.85

Calls 4

processMethod · 0.95
finalizeMethod · 0.95
finalizeMethod · 0.95
createEventCollectorFunction · 0.85

Tested by

no test coverage detected