@@ -18,7 +18,7 @@ function pad(status: string) {
1818}
1919
2020// Borrowed from https://github.com/mikeal/logref/blob/master/main.js#L6-15
21- function formatter ( message : string , ctx : Record < string , string | number > ) {
21+ function formatter ( message : string , context : Record < string , string | number > ) {
2222 while ( message . includes ( '%' ) ) {
2323 const start = message . indexOf ( '%' ) ;
2424 let end = message . indexOf ( ' ' , start ) ;
@@ -27,7 +27,7 @@ function formatter(message: string, ctx: Record<string, string | number>) {
2727 end = message . length ;
2828 }
2929
30- message = `${ message . slice ( 0 , start ) } ${ ctx [ message . slice ( start + 1 , end ) ] } ${ message . slice ( end ) } ` ;
30+ message = `${ message . slice ( 0 , start ) } ${ context [ message . slice ( start + 1 , end ) ] } ${ message . slice ( end ) } ` ;
3131 }
3232
3333 return message ;
@@ -91,11 +91,11 @@ export function createLogger<Loggers = any, LoggerCategories extends string | nu
9191 // @param {Object } params.colors status mappings
9292 //
9393 // Returns the logger
94- function log ( message : string , ctx ?: Record < string , string | number > ) {
94+ function log ( message : string , context ?: Record < string , string | number > ) {
9595 message ??= '' ;
9696
97- if ( typeof ctx === 'object' && ! Array . isArray ( ctx ) ) {
98- customConsole . error ( formatter ( message , ctx ) ) ;
97+ if ( typeof context === 'object' && ! Array . isArray ( context ) ) {
98+ customConsole . error ( formatter ( message , context ) ) ;
9999 } else {
100100 // eslint-disable-next-line prefer-rest-params
101101 customConsole . error ( ...arguments ) ;
@@ -110,28 +110,28 @@ export function createLogger<Loggers = any, LoggerCategories extends string | nu
110110 // A simple write method, with formatted message.
111111 //
112112 // Returns the logger
113- log . write = function ( ...args : Parameters < typeof util . format > ) {
114- stderr . write ( util . format ( ...args ) ) ;
113+ log . write = function ( ...arguments_ : Parameters < typeof util . format > ) {
114+ stderr . write ( util . format ( ...arguments_ ) ) ;
115115 return this ;
116116 } ;
117117
118118 // Same as `log.write()` but automatically appends a `\n` at the end
119119 // of the message.
120- log . writeln = function ( ...args : Parameters < typeof util . format > ) {
121- this . write ( ...args ) ;
120+ log . writeln = function ( ...arguments_ : Parameters < typeof util . format > ) {
121+ this . write ( ...arguments_ ) ;
122122 this . write ( '\n' ) ;
123123 return this ;
124124 } ;
125125
126126 // Convenience helper to write sucess status, this simply prepends the
127127 // message with a gren `✔`.
128- log . ok = function ( ...args : Parameters < typeof util . format > ) {
129- this . write ( `${ logSymbols . success } ${ util . format ( ...args ) } \n` ) ;
128+ log . ok = function ( ...arguments_ : Parameters < typeof util . format > ) {
129+ this . write ( `${ logSymbols . success } ${ util . format ( ...arguments_ ) } \n` ) ;
130130 return this ;
131131 } ;
132132
133- log . error = function ( ...args : Parameters < typeof util . format > ) {
134- this . write ( `${ logSymbols . error } ${ util . format ( ...args ) } \n` ) ;
133+ log . error = function ( ...arguments_ : Parameters < typeof util . format > ) {
134+ this . write ( `${ logSymbols . error } ${ util . format ( ...arguments_ ) } \n` ) ;
135135 return this ;
136136 } ;
137137
@@ -169,9 +169,9 @@ export function createLogger<Loggers = any, LoggerCategories extends string | nu
169169 // Returns the logger
170170 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
171171 // @ts -expect-error
172- log [ status ] = function ( ...args : Parameters < typeof util . format > ) {
172+ log [ status ] = function ( ...arguments_ : Parameters < typeof util . format > ) {
173173 this . write ( color ( pad ( status ) ) ) . write ( padding ) ;
174- this . write ( `${ util . format ( ...args ) } \n` ) ;
174+ this . write ( `${ util . format ( ...arguments_ ) } \n` ) ;
175175 return this ;
176176 } ;
177177 }
0 commit comments