mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-18 21:49:31 +02:00
Added support for null values: empty xml tag
This commit is contained in:
@@ -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}`;
|
||||
|
Reference in New Issue
Block a user