import chalk from "chalk" ; export function format ( message , messageType , scope ? ) { let prefix = { error : " " + chalk . red ( "error" ) , success : " " + chalk . green ( "success" ) , info : " " + chalk . cyan ( "info" ) , none : "" , } [ messageType ] ; let fullPrefix = "🎁" + prefix + ( scope ? " " + chalk . cyan ( scope ) : "" ) ; return String ( message ) . split ( "\n" ) . map ( ( line ) => { if ( ! line . trim ( ) ) { return fullPrefix ; } return `${ fullPrefix } ${ line }` ; } ) . join ( "\n" ) ; } export function error ( message , scope ? ) { console . error ( format ( message , "error" , scope ) ) ; } export function success ( message , scope ? ) { console . log ( format ( message , "success" , scope ) ) ; } export function info ( message , scope ? ) { console . log ( format ( message , "info" , scope ) ) ; } export function log ( message ) { console . log ( format ( message , "none" ) ) ; }