diff --git a/lib/figlet.js b/lib/figlet.js index ddd110f..4c88fa5 100644 --- a/lib/figlet.js +++ b/lib/figlet.js @@ -896,13 +896,17 @@ var figlet = figlet || (function() { if (typeof options.horizontalLayout !== 'undefined') { params = getHorizontalFittingRules(options.horizontalLayout, fontOpts); for (prop in params) { - myOpts.fittingRules[prop] = params[prop]; + if (params.hasOwnProperty(prop)) { + myOpts.fittingRules[prop] = params[prop]; + } } } if (typeof options.verticalLayout !== 'undefined') { params = getVerticalFittingRules(options.verticalLayout, fontOpts); for (prop in params) { - myOpts.fittingRules[prop] = params[prop]; + if (params.hasOwnProperty(prop)) { + myOpts.fittingRules[prop] = params[prop]; + } } } myOpts.printDirection = (typeof options.printDirection !== 'undefined') ? options.printDirection : fontOpts.printDirection; @@ -1131,7 +1135,9 @@ var figlet = figlet || (function() { }); }, Promise.resolve()).then(function(res){ for(var i in fonts){ - me.parseFont(fonts[i], fontData[i]); + if (fonts.hasOwnProperty(i)) { + me.parseFont(fonts[i], fontData[i]); + } } if(next)next();