MCPcopy Create free account
hub / github.com/PaperElectron/Sundry / separate

Function separate

cli/interactive.js:318–342  ·  view source on GitHub ↗

* * @param color * @param message * @param {boolean} plain If false returns a inquirer separator for use in lists. * @returns {*}

(color, message, plain)

Source from the content-addressed store, hash-verified

316 * @returns {*}
317 */
318function 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 */

Callers 4

backendlistFunction · 0.85
deleteBackendFunction · 0.85
hostMetadataFunction · 0.85
hostListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected