@@ -202,7 +202,7 @@ function stylizeWithColor(str, styleType) {
202202
203203 if ( style ) {
204204 return '\u001b[' + inspect . colors [ style ] [ 0 ] + 'm' + str +
205- '\u001b[' + inspect . colors [ style ] [ 1 ] + 'm' ;
205+ '\u001b[' + inspect . colors [ style ] [ 1 ] + 'm' ;
206206 } else {
207207 return str ;
208208 }
@@ -229,12 +229,12 @@ function formatValue(ctx, value, recurseTimes) {
229229 // Provide a hook for user-specified inspect functions.
230230 // Check that value is an object with an inspect function on it
231231 if ( ctx . customInspect &&
232- value &&
233- isFunction ( value . inspect ) &&
234- // Filter out the util module, it's inspect function is special
235- value . inspect !== exports . inspect &&
236- // Also filter out any prototype objects using the circular check.
237- ! ( value . constructor && value . constructor . prototype === value ) ) {
232+ value &&
233+ isFunction ( value . inspect ) &&
234+ // Filter out the util module, it's inspect function is special
235+ value . inspect !== exports . inspect &&
236+ // Also filter out any prototype objects using the circular check.
237+ ! ( value . constructor && value . constructor . prototype === value ) ) {
238238 var ret = value . inspect ( recurseTimes , ctx ) ;
239239 if ( ! isString ( ret ) ) {
240240 ret = formatValue ( ctx , ret , recurseTimes ) ;
@@ -259,7 +259,7 @@ function formatValue(ctx, value, recurseTimes) {
259259 // IE doesn't make error fields non-enumerable
260260 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
261261 if ( isError ( value )
262- && ( keys . indexOf ( 'message' ) >= 0 || keys . indexOf ( 'description' ) >= 0 ) ) {
262+ && ( keys . indexOf ( 'message' ) >= 0 || keys . indexOf ( 'description' ) >= 0 ) ) {
263263 return formatError ( value ) ;
264264 }
265265
@@ -343,8 +343,8 @@ function formatPrimitive(ctx, value) {
343343 return ctx . stylize ( 'undefined' , 'undefined' ) ;
344344 if ( isString ( value ) ) {
345345 var simple = '\'' + JSON . stringify ( value ) . replace ( / ^ " | " $ / g, '' )
346- . replace ( / ' / g, "\\'" )
347- . replace ( / \\ " / g, '"' ) + '\'' ;
346+ . replace ( / ' / g, "\\'" )
347+ . replace ( / \\ " / g, '"' ) + '\'' ;
348348 return ctx . stylize ( simple , 'string' ) ;
349349 }
350350 if ( isNumber ( value ) )
@@ -367,15 +367,15 @@ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
367367 for ( var i = 0 , l = value . length ; i < l ; ++ i ) {
368368 if ( hasOwnProperty ( value , String ( i ) ) ) {
369369 output . push ( formatProperty ( ctx , value , recurseTimes , visibleKeys ,
370- String ( i ) , true ) ) ;
370+ String ( i ) , true ) ) ;
371371 } else {
372372 output . push ( '' ) ;
373373 }
374374 }
375375 keys . forEach ( function ( key ) {
376376 if ( ! key . match ( / ^ \d + $ / ) ) {
377377 output . push ( formatProperty ( ctx , value , recurseTimes , visibleKeys ,
378- key , true ) ) ;
378+ key , true ) ) ;
379379 }
380380 } ) ;
381381 return output ;
@@ -431,8 +431,8 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
431431 name = ctx . stylize ( name , 'name' ) ;
432432 } else {
433433 name = name . replace ( / ' / g, "\\'" )
434- . replace ( / \\ " / g, '"' )
435- . replace ( / ( ^ " | " $ ) / g, "'" ) ;
434+ . replace ( / \\ " / g, '"' )
435+ . replace ( / ( ^ " | " $ ) / g, "'" ) ;
436436 name = ctx . stylize ( name , 'string' ) ;
437437 }
438438 }
@@ -451,11 +451,11 @@ function reduceToSingleString(output, base, braces) {
451451
452452 if ( length > 60 ) {
453453 return braces [ 0 ] +
454- ( base === '' ? '' : base + '\n ' ) +
455- ' ' +
456- output . join ( ',\n ' ) +
457- ' ' +
458- braces [ 1 ] ;
454+ ( base === '' ? '' : base + '\n ' ) +
455+ ' ' +
456+ output . join ( ',\n ' ) +
457+ ' ' +
458+ braces [ 1 ] ;
459459 }
460460
461461 return braces [ 0 ] + base + ' ' + output . join ( ', ' ) + ' ' + braces [ 1 ] ;
@@ -525,7 +525,7 @@ exports.types.isDate = isDate;
525525
526526function isError ( e ) {
527527 return isObject ( e ) &&
528- ( objectToString ( e ) === '[object Error]' || e instanceof Error ) ;
528+ ( objectToString ( e ) === '[object Error]' || e instanceof Error ) ;
529529}
530530exports . isError = isError ;
531531exports . types . isNativeError = isError ;
@@ -537,11 +537,11 @@ exports.isFunction = isFunction;
537537
538538function isPrimitive ( arg ) {
539539 return arg === null ||
540- typeof arg === 'boolean' ||
541- typeof arg === 'number' ||
542- typeof arg === 'string' ||
543- typeof arg === 'symbol' || // ES6 symbol
544- typeof arg === 'undefined' ;
540+ typeof arg === 'boolean' ||
541+ typeof arg === 'number' ||
542+ typeof arg === 'string' ||
543+ typeof arg === 'symbol' || // ES6 symbol
544+ typeof arg === 'undefined' ;
545545}
546546exports . isPrimitive = isPrimitive ;
547547
@@ -558,14 +558,14 @@ function pad(n) {
558558
559559
560560var months = [ 'Jan' , 'Feb' , 'Mar' , 'Apr' , 'May' , 'Jun' , 'Jul' , 'Aug' , 'Sep' ,
561- 'Oct' , 'Nov' , 'Dec' ] ;
561+ 'Oct' , 'Nov' , 'Dec' ] ;
562562
563563// 26 Feb 16:19:34
564564function timestamp ( ) {
565565 var d = new Date ( ) ;
566566 var time = [ pad ( d . getHours ( ) ) ,
567- pad ( d . getMinutes ( ) ) ,
568- pad ( d . getSeconds ( ) ) ] . join ( ':' ) ;
567+ pad ( d . getMinutes ( ) ) ,
568+ pad ( d . getSeconds ( ) ) ] . join ( ':' ) ;
569569 return [ d . getDate ( ) , months [ d . getMonth ( ) ] , time ] . join ( ' ' ) ;
570570}
571571
@@ -704,12 +704,13 @@ function callbackify(original) {
704704 // implications (stack, `uncaughtException`, `async_hooks`)
705705 original . apply ( this , args )
706706 . then ( function ( ret ) { process . nextTick ( cb . bind ( null , null , ret ) ) } ,
707- function ( rej ) { process . nextTick ( callbackifyOnRejected . bind ( null , rej , cb ) ) } ) ;
707+ function ( rej ) { process . nextTick ( callbackifyOnRejected . bind ( null , rej , cb ) ) } ) ;
708708 }
709709
710710 Object . setPrototypeOf ( callbackified , Object . getPrototypeOf ( original ) ) ;
711- Object . defineProperties ( callbackified ,
712- getOwnPropertyDescriptors ( original ) ) ;
711+ const desc = getOwnPropertyDescriptors ( original ) ;
712+ desc . length . value += 1 ;
713+ Object . defineProperties ( callbackified , desc ) ;
713714 return callbackified ;
714715}
715716exports . callbackify = callbackify ;
0 commit comments