* * @param color * @param message * @param {boolean} plain If false returns a inquirer separator for use in lists. * @returns {*}
(color, message, plain)
| 316 | * @returns {*} |
| 317 | */ |
| 318 | function separate(color, message, plain){ |
| 319 | if(_.isBoolean(message)){ |
| 320 | plain = message |
| 321 | message = false |
| 322 | } |
| 323 | var format = message ? ' ' + message + ' ' : [] |
| 324 | var count = (format.length >= 80) ? 0 : 80 - format.length |
| 325 | /** |
| 326 | * Add invisible chars here after length has been established |
| 327 | */ |
| 328 | format = chalk.bold(format); |
| 329 | for(; count--;){ |
| 330 | if(count % 2){ |
| 331 | format = '-' + format |
| 332 | } |
| 333 | else{ |
| 334 | format = format + '-' |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | if(plain){ |
| 339 | return chalk[color](format) |
| 340 | } |
| 341 | return new inquirer.Separator(chalk[color](format)) |
| 342 | } |
| 343 | /* |
| 344 | * For shame for shame, inquirer breaks node conventions, and doesn't return error first callbacks. |
| 345 | */ |
no outgoing calls
no test coverage detected