printing primitive arrays in opts in one line

This fixes #22 and prints all arrays that contain only primitive values in one line like the key or cert buffer
This commit is contained in:
F. N 2016-02-16 23:04:56 +01:00
parent e6e38f3ada
commit d81a2d0919
1 changed files with 6 additions and 1 deletions

View File

@ -19,8 +19,13 @@ module.exports.create = function (opts) {
if (!opts) { throw new Error("requires opts to be an object"); }
if (opts.debug) {
console.debug("[LEX] creating sniCallback", JSON.stringify(opts, null, ' '));
console.debug("[LEX] creating sniCallback", JSON.stringify(opts, function(k,v){
if(v instanceof Array)
return JSON.stringify(v);
return v;
},' '));
}
if (!opts.letsencrypt) { throw new Error("requires opts.letsencrypt to be a letsencrypt instance"); }
if (!opts.lifetime) { opts.lifetime = 90 * 24 * 60 * 60 * 1000; }