Comparing version 0.2.4 to 0.3.0
18
cli.js
@@ -6,2 +6,14 @@ #!/usr/bin/env node | ||
const getValues = param => { | ||
if (typeof param.default === 'boolean') { | ||
return 'true or false'; | ||
} | ||
const options = param.options ? param.options.slice(0, -1).join(', ') + ' or ' + param.options.pop() : ''; | ||
let range = param.range ? `From ${param.range[0]} to ${param.range[1]}` : ''; | ||
range += range && options ? '<br>' : ''; | ||
return range + options; | ||
}; | ||
const rowTemplate = (name, param) => ` | ||
@@ -12,5 +24,3 @@ <tr> | ||
<td>${param.default}</td> | ||
<td>${typeof param.default === 'boolean' ? 'true or false' : | ||
param.range instanceof Array ? `From ${param.range[0]} to ${param.range[1]}` : | ||
param.range || ''}</td> | ||
<td>${getValues(param)}</td> | ||
<td>${param.description || ''}</td> | ||
@@ -27,3 +37,3 @@ </tr>`; | ||
<th width="50">Default</th> | ||
<th width="150">Range</th> | ||
<th width="150">Values</th> | ||
<th width="150">Description</th> | ||
@@ -30,0 +40,0 @@ </tr> |
{ | ||
"name": "mhr", | ||
"description": "The util creates readme for creative", | ||
"version": "0.2.4", | ||
"version": "0.3.0", | ||
"bin": { | ||
@@ -6,0 +6,0 @@ "mhr": "cli.js" |
1701
43