Skip to content
This repository was archived by the owner on Jan 7, 2021. It is now read-only.

Commit 6bef414

Browse files
committed
Merge pull request #60 from idy/issue-37
fix issue #37
2 parents 321b134 + 69a937d commit 6bef414

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/json2xml.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ module.exports = function toXml(json, xml) {
2121
// First pass, extract strings only
2222
for (var i = 0; i < len; i++) {
2323
var key = keys[i], value = obj[key], isArray = Array.isArray(value);
24-
if (typeof(obj[key]) == 'string' || isArray) {
24+
var type = typeof(value);
25+
if (type == 'string' || type == 'number' || type == 'boolean' || isArray) {
2526
var it = isArray ? value : [value];
2627

2728
it.forEach(function(subVal) {

0 commit comments

Comments
 (0)