command-line-usage
Advanced tools
Comparing version 5.0.4 to 5.0.5
@@ -8,6 +8,10 @@ const chalk = require('chalk') | ||
function chalkFormat (str) { | ||
str = str.replace(/`/g, '\\`') | ||
return format(str) | ||
if (str) { | ||
str = str.replace(/`/g, '\\`') | ||
return format(str) | ||
} else { | ||
return '' | ||
} | ||
} | ||
module.exports = chalkFormat |
@@ -22,2 +22,8 @@ 'use strict' | ||
/* All definitions must have a name */ | ||
const validNames = definitions.every(d => d.name) | ||
if (!validNames) { | ||
throw new Error('Every definition in the optionList must have a `name` property') | ||
} | ||
if (data.header) this.header(data.header) | ||
@@ -24,0 +30,0 @@ |
{ | ||
"name": "command-line-usage", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "5.0.4", | ||
"version": "5.0.5", | ||
"description": "Generates command-line usage information", | ||
@@ -27,3 +27,3 @@ "repository": "https://github.com/75lb/command-line-usage.git", | ||
"array-back": "^2.0.0", | ||
"chalk": "^2.3.2", | ||
"chalk": "^2.4.1", | ||
"table-layout": "^0.4.3", | ||
@@ -30,0 +30,0 @@ "typical": "^2.6.1" |
26149
327
Updatedchalk@^2.4.1