mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-11-11 18:49:53 +05:30
Added support for null values: empty xml tag
This commit is contained in:
parent
52666b2780
commit
63884cd5ea
1 changed files with 6 additions and 1 deletions
|
|
@ -57,7 +57,12 @@ const convertObjectToXml = (
|
|||
: `${escapeXml(String(item))}`;
|
||||
xml += `</${keyString}>${newline}`;
|
||||
});
|
||||
} else if (typeof value === 'object' && value !== null) {
|
||||
} else if (value === null) {
|
||||
xml += `${getIndentation(
|
||||
options,
|
||||
depth
|
||||
)}<${keyString}></${keyString}>${newline}`;
|
||||
} else if (typeof value === 'object') {
|
||||
xml += `${getIndentation(options, depth)}<${keyString}>${newline}`;
|
||||
xml += convertObjectToXml(value, options, depth + 1);
|
||||
xml += `${getIndentation(options, depth)}</${keyString}>${newline}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue