Skip to content

xml

Utils to parse, format and write XML.

Type Aliases

ParsedXmlAttribute

type ParsedXmlAttribute: Record<string, string>;

Defined in

tmp/commons/src/lib/utils/xml.ts:304


parsedXmlComment

type parsedXmlComment: object;

Type declaration

#comment
#comment: string;

Defined in

tmp/commons/src/lib/utils/xml.ts:311


ParsedXmlNode

type ParsedXmlNode: object;

Index Signature

[key: string]: ParsedXmlAttribute | ParsedXmlNode[] | string | undefined

Type declaration

#text?
optional #text: string;

Defined in

tmp/commons/src/lib/utils/xml.ts:306


ParsedXmlNodes

type ParsedXmlNodes: (parsedXmlComment | object)[];

Defined in

tmp/commons/src/lib/utils/xml.ts:315

Functions

buildXml()

function buildXml(__namedParameters): string

Parameters

__namedParameters

__namedParameters.baseSpace?: string = ''

__namedParameters.cursorTag?: string

__namedParameters.endWithNewLine?: boolean = true

__namedParameters.indent?: number = 2

__namedParameters.parsedXml: ParsedXmlNodes

Returns

string

Defined in

tmp/commons/src/lib/utils/xml.ts:56


findPossibleMergePositions()

function findPossibleMergePositions(param0): object[]

Returns the different paths to the possible merge positions

Parameters

param0

param0.baseXml: ParsedXmlNodes

param0.cursorTag?: string

param0.element: string

param0.typesPaths: Map<string, string[][] | "infinite">

Returns

object[]

Defined in

tmp/commons/src/lib/utils/xml.ts:142


formatComment()

function formatComment(comment): string

Parameters

comment: string

Returns

string

Defined in

tmp/commons/src/lib/utils/xml.ts:300


formatXml()

function formatXml(__namedParameters): string

Parameters

__namedParameters

__namedParameters.indent?: number = 2

__namedParameters.xml: string

Returns

string

Defined in

tmp/commons/src/lib/utils/xml.ts:295


formatXMLArray()

function formatXMLArray(arr): string

Parameters

arr: unknown[]

Returns

string

Defined in

tmp/commons/src/lib/utils/xml.ts:30


getElementFromParsedXml()

function getElementFromParsedXml(xml): string | null

Parameters

xml: Record<string, unknown>

Returns

string | null

Defined in

tmp/commons/src/lib/utils/xml.ts:129


getXmlAttributes()

function getXmlAttributes(xml): Record<string, string>

Parameters

xml

xml.:@?: ParsedXmlAttribute

Returns

Record<string, string>

Defined in

tmp/commons/src/lib/utils/xml.ts:197


mergeParsedXml()

function mergeParsedXml(__namedParameters): ParsedXmlNodes

Parameters

__namedParameters

__namedParameters.baseXml: ParsedXmlNodes

__namedParameters.cursorTag?: string

__namedParameters.newXml: ParsedXmlNodes

__namedParameters.typesPaths: Map<string, string[][] | "infinite">

Returns

ParsedXmlNodes

Defined in

tmp/commons/src/lib/utils/xml.ts:226


parseXml()

function parseXml(xml): ParsedXmlNodes

Parameters

xml: string

Returns

ParsedXmlNodes

Defined in

tmp/commons/src/lib/utils/xml.ts:48


parseXMLArray()

function parseXMLArray(xml): unknown[] | undefined

Parameters

xml: string

Returns

unknown[] | undefined

Defined in

tmp/commons/src/lib/utils/xml.ts:12