// loaders.gl, MIT license import { XMLLoader } from '@loaders.gl/xml'; /** * Parses a typed data structure from raw XML for `GetCapabilities` response * @note Error handlings is fairly weak */ export function parseWFSCapabilities(text, options) { const parsedXML = XMLLoader.parseTextSync?.(text, { ...options, xml: { ...options?.xml, removeNSPrefix: true, uncapitalizeKeys: true } }); const xmlCapabilities = parsedXML.Capabilities || parsedXML; return xmlCapabilities; }