MCPcopy Index your code
hub / github.com/simstudioai/sim / extractTag

Function extractTag

apps/sim/connectors/s3/s3.ts:389–392  ·  view source on GitHub ↗

* Extracts the text content of the first matching XML tag within a fragment.

(fragment: string, tag: string)

Source from the content-addressed store, hash-verified

387 * Extracts the text content of the first matching XML tag within a fragment.
388 */
389function extractTag(fragment: string, tag: string): string | undefined {
390 const match = fragment.match(new RegExp(`<${tag}>([\\s\\S]*?)</${tag}>`))
391 return match ? decodeXmlEntities(match[1]) : undefined
392}
393
394/**
395 * Parses a ListObjectsV2 XML response into object entries plus pagination state.

Callers 1

parseListResponseFunction · 0.85

Calls 1

decodeXmlEntitiesFunction · 0.85

Tested by

no test coverage detected