fix: declare default parameter values in xmlUtils.prettyXml (#181)

development
Thomas Bouffard 2023-03-05 12:03:24 +01:00 committed by GitHub
parent 1447fd29fc
commit d33769fad5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 12 deletions

View File

@ -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;