MCPcopy Create free account
hub / github.com/denoland/std / parseName

Function parseName

xml/_common.ts:549–560  ·  view source on GitHub ↗
(name: string, uri?: string)

Source from the content-addressed store, hash-verified

547 * @returns An XmlName object with raw, local, optional prefix, and optional uri.
548 */
549export function parseName(name: string, uri?: string): XmlName {
550 const colonIndex = name.indexOf(":");
551 if (colonIndex === -1) {
552 return { raw: name, local: name };
553 }
554 return {
555 raw: name,
556 prefix: name.slice(0, colonIndex),
557 local: name.slice(colonIndex + 1),
558 ...(uri !== undefined && { uri }),
559 };
560}

Callers 2

_common_test.tsFile · 0.90
parseSyncFunction · 0.90

Calls 1

sliceMethod · 0.45

Tested by

no test coverage detected