@@ -677,7 +677,10 @@ export const log = {
677
677
678
678
const prefix = `${ color . gray ( S_BAR ) } ` ;
679
679
export const stream = {
680
- message : async ( iterable : Iterable < string > | AsyncIterable < string > , { symbol = color . gray ( S_BAR ) } : LogMessageOptions = { } ) => {
680
+ message : async (
681
+ iterable : Iterable < string > | AsyncIterable < string > ,
682
+ { symbol = color . gray ( S_BAR ) } : LogMessageOptions = { }
683
+ ) => {
681
684
process . stdout . write ( `${ color . gray ( S_BAR ) } \n${ symbol } ` ) ;
682
685
let lineWidth = 3 ;
683
686
for await ( let chunk of iterable ) {
@@ -686,7 +689,7 @@ export const stream = {
686
689
lineWidth = 3 + strip ( chunk . slice ( chunk . lastIndexOf ( '\n' ) ) ) . length ;
687
690
}
688
691
const chunkLen = strip ( chunk ) . length ;
689
- if ( ( lineWidth + chunkLen ) < process . stdout . columns ) {
692
+ if ( lineWidth + chunkLen < process . stdout . columns ) {
690
693
lineWidth += chunkLen ;
691
694
process . stdout . write ( chunk ) ;
692
695
} else {
@@ -696,26 +699,26 @@ export const stream = {
696
699
}
697
700
process . stdout . write ( '\n' ) ;
698
701
} ,
699
- info : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
702
+ info : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
700
703
return stream . message ( iterable , { symbol : color . blue ( S_INFO ) } ) ;
701
704
} ,
702
- success : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
705
+ success : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
703
706
return stream . message ( iterable , { symbol : color . green ( S_SUCCESS ) } ) ;
704
707
} ,
705
- step : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
708
+ step : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
706
709
return stream . message ( iterable , { symbol : color . green ( S_STEP_SUBMIT ) } ) ;
707
710
} ,
708
- warn : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
711
+ warn : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
709
712
return stream . message ( iterable , { symbol : color . yellow ( S_WARN ) } ) ;
710
713
} ,
711
714
/** alias for `log.warn()`. */
712
- warning : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
715
+ warning : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
713
716
return stream . warn ( iterable ) ;
714
717
} ,
715
- error : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
718
+ error : ( iterable : Iterable < string > | AsyncIterable < string > ) => {
716
719
return stream . message ( iterable , { symbol : color . red ( S_ERROR ) } ) ;
717
720
} ,
718
- }
721
+ } ;
719
722
720
723
export const spinner = ( ) => {
721
724
const frames = unicode ? [ '◒' , '◐' , '◓' , '◑' ] : [ '•' , 'o' , 'O' , '0' ] ;
0 commit comments