diff --git a/README.md b/README.md index b6570e9..1e2e510 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ Options are : * {colors} [colors] : Output colors. See below * {boolean} [alignKeyValues] : Align key values. Default: true * {boolean} [hideUndefined] : Do not display undefined values. Default: false + * {boolean} [noSeparator] : Do not display key separator Default: false Colors are : * {string} [keys] : Objects keys color. Default: green diff --git a/lib/prettyoutput.js b/lib/prettyoutput.js index 21883bc..4d71b3d 100644 --- a/lib/prettyoutput.js +++ b/lib/prettyoutput.js @@ -17,6 +17,7 @@ exports.internals = internals * @property {colors} [colors] - input colors * @property {boolean} [alignKeyValues] - Align key values. Default: true * @property {boolean} [hideUndefined] - Show undefined values. Default: false + * @property {boolean} [noSeparator] - Do not display key separator. Default: false */ /** @@ -57,7 +58,8 @@ internals.parseOptions = opts => { maxDepth: opts.maxDepth || 3, colors: !opts.noColor ? colors : null, alignKeyValues: _.isBoolean(opts.alignKeyValues) ? opts.alignKeyValues : true, - hideUndefined: _.isBoolean(opts.hideUndefined) ? opts.hideUndefined : false + hideUndefined: _.isBoolean(opts.hideUndefined) ? opts.hideUndefined : false, + noSeparator: _.isBoolean(opts.noSeparator) ? opts.noSeparator : false } } diff --git a/lib/renderer.js b/lib/renderer.js index 9a55915..cbb032d 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -57,7 +57,7 @@ exports.renderEmptyArray = function(options, indentation) { exports.renderObjectKey = function(key, options, indentation) { const colors = options.colors || {} - const output = `${indentation}${key}: ` + const output = `${indentation}${key}${options.noSeparator ? '' : ':'} ` return utils.colorString(output, colors.keys) }