( path: ReadonlyArray<string>, options?: ElementsOptions )
| 598 | * @since 4.0.6 |
| 599 | */ |
| 600 | export const elements = <IE = never, Done = unknown>( |
| 601 | path: ReadonlyArray<string>, |
| 602 | options?: ElementsOptions |
| 603 | ): Channel.Channel< |
| 604 | Arr.NonEmptyReadonlyArray<Element>, |
| 605 | XmlError | IE, |
| 606 | Done, |
| 607 | Arr.NonEmptyReadonlyArray<Event>, |
| 608 | IE, |
| 609 | Done |
| 610 | > => { |
| 611 | if (path.length === 0) { |
| 612 | throw new Error("Xml: elements path must not be empty") |
| 613 | } |
| 614 | const segments = Array.from(path, parseSegment) |
| 615 | const maxElementSize = checkLimit("maxElementSize", options?.maxElementSize, defaultMaxElementSize) |
| 616 | return makeChannel<Event, Element, IE, Done>(() => new Collector(segments, maxElementSize)) |
| 617 | } |
| 618 | |
| 619 | /** |
| 620 | * Returns an attribute's value by namespace URI and local name, or `Option.none()` |
nothing calls this directly
no test coverage detected