Parses a qualified name string into an XmlName object.
( raw: string, colonIndex: number, uri?: string, )
| 30 | |
| 31 | /** Parses a qualified name string into an XmlName object. */ |
| 32 | function parseName( |
| 33 | raw: string, |
| 34 | colonIndex: number, |
| 35 | uri?: string, |
| 36 | ): XmlName { |
| 37 | if (colonIndex === -1) { |
| 38 | return { raw, local: raw }; |
| 39 | } |
| 40 | return { |
| 41 | raw, |
| 42 | local: raw.slice(colonIndex + 1), |
| 43 | prefix: raw.slice(0, colonIndex), |
| 44 | ...(uri !== undefined && { uri }), |
| 45 | }; |
| 46 | } |
| 47 | |
| 48 | /** Creates callbacks that collect events into an array. */ |
| 49 | function createEventCollector(): { |
no test coverage detected