Skip to content

Commit 0f87aba

Browse files
committed
Fixing #30, incrementing to 1.3.1
1 parent 697a68d commit 0f87aba

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "json-2-csv",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"homepage": "https://github.com/mrodrig/json-2-csv",
55
"moduleType": [
66
"node"
@@ -18,4 +18,4 @@
1818
"underscore": "1.8.3",
1919
"bluebird": "2.9.24"
2020
}
21-
}
21+
}

lib/json-2-csv.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ var convertField = function (value) {
9696
return options.DELIMITER.WRAP + value.toString() + options.DELIMITER.WRAP;
9797
} else if (_.isObject(value)) { // If we have an object
9898
return options.DELIMITER.WRAP + convertData(value, _.keys(value)) + options.DELIMITER.WRAP; // Push the recursively generated CSV
99+
} else if (_.isNumber(value)) { // If we have a number (avoids 0 being converted to '')
100+
return options.DELIMITER.WRAP + value.toString() + options.DELIMITER.WRAP;
99101
}
100102
return options.DELIMITER.WRAP + (value ? value.toString() : '') + options.DELIMITER.WRAP; // Otherwise push the current value
101103
};
@@ -165,4 +167,4 @@ module.exports = {
165167
});
166168
}
167169

168-
};
170+
};

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "mrodrig",
33
"name": "json-2-csv",
44
"description": "A JSON to CSV and CSV to JSON converter that natively supports sub-documents and auto-generates the CSV heading.",
5-
"version": "1.3.0",
5+
"version": "1.3.1",
66
"repository": {
77
"type": "git",
88
"url": "http://github.com/mrodrig/json-2-csv.git"
@@ -38,4 +38,4 @@
3838
"node": "*"
3939
},
4040
"license": "MIT"
41-
}
41+
}

0 commit comments

Comments
 (0)