Skip to content

Commit

Permalink
Add additional 'undefined' checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Tusch committed Aug 12, 2015
1 parent af043a2 commit ea4d629
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ exports.asTree = function(sorted) {
exports.asCSV = function(sorted, customFormat) {
var text = [ ], textArr = [ ], lineArr = [ ];

if (Object.keys(customFormat).length > 0) {
if (customFormat && Object.keys(customFormat).length > 0) {
textArr = [ ];
textArr.push('"module name"');

Expand All @@ -191,7 +191,7 @@ exports.asCSV = function(sorted, customFormat) {
lineArr = [ ];

//Grab the custom keys from the custom format
if (Object.keys(customFormat).length > 0) {
if (customFormat && Object.keys(customFormat).length > 0) {
lineArr.push('"' + key + '"');
Object.keys(customFormat).forEach(function forEachCallback(item) {
lineArr.push('"' + module[item] + '"');
Expand Down Expand Up @@ -220,7 +220,7 @@ exports.asCSV = function(sorted, customFormat) {
exports.asMarkDown = function(sorted, customFormat) {

var text = [];
if (Object.keys(customFormat).length > 0) {
if (customFormat && Object.keys(customFormat).length > 0) {

Object.keys(sorted).forEach(function sortedCallback(sortedItem) {

Expand Down

0 comments on commit ea4d629

Please sign in to comment.