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

Function elements

packages/effect/src/encoding/Xml.ts:600–617  ·  view source on GitHub ↗
(
  path: ReadonlyArray<string>,
  options?: ElementsOptions
)

Source from the content-addressed store, hash-verified

598 * @since 4.0.6
599 */
600export 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()`

Callers

nothing calls this directly

Calls 3

checkLimitFunction · 0.85
fromMethod · 0.80
makeChannelFunction · 0.70

Tested by

no test coverage detected