From d33769fad5e6c2ee1dd216939e07deb4745381b7 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Sun, 5 Mar 2023 12:03:24 +0100 Subject: [PATCH] fix: declare default parameter values in xmlUtils.prettyXml (#181) --- packages/core/src/util/xmlUtils.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/core/src/util/xmlUtils.ts b/packages/core/src/util/xmlUtils.ts index 035525def..9dc3b2aaa 100644 --- a/packages/core/src/util/xmlUtils.ts +++ b/packages/core/src/util/xmlUtils.ts @@ -128,25 +128,20 @@ export const getXml = (node: Element, linefeed = ' '): string => { * * @param node DOM node to return the XML for. * @param tab Optional string that specifies the indentation for one level. - * Default is two spaces. * @param indent Optional string that represents the current indentation. - * Default is an empty string. - * @param newline Option string that represents a linefeed. Default is '\n'. + * @param newline Optional string that represents a linefeed. + * @param ns Optional string that represents the target namespace URI. */ export const getPrettyXml = ( - node: Element, - tab: string, - indent: string, - newline: string, - ns: string + node: Element | null, + tab = ' ', + indent = '', + newline = '\n', + ns: string | null = null ): string => { const result = []; if (node != null) { - tab = tab != null ? tab : ' '; - indent = indent != null ? indent : ''; - newline = newline != null ? newline : '\n'; - if (node.namespaceURI != null && node.namespaceURI !== ns) { ns = node.namespaceURI;