File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
33const wrapFunction = fn => {
4- console . log ( 'Wrap function: ' + fn . name ) ;
4+ console . log ( 'Wrap function:' , fn . name ) ;
55 return ( ...args ) => {
6- console . log ( 'Called wrapper for: ' + fn . name ) ;
6+ console . log ( 'Called wrapper for:' , fn . name ) ;
77 console . dir ( { args } ) ;
88 if ( args . length > 0 ) {
9- let callback = args [ args . length - 1 ] ;
9+ const callback = args [ args . length - 1 ] ;
1010 if ( typeof callback === 'function' ) {
1111 args [ args . length - 1 ] = ( ...args ) => {
12- console . log ( 'Callback: ' + fn . name ) ;
12+ console . log ( 'Callback:' , fn . name ) ;
1313 callback ( ...args ) ;
1414 } ;
15- } else {
16- callback = null ;
1715 }
1816 }
19- console . log ( 'Call: ' + fn . name ) ;
17+ console . log ( 'Call:' , fn . name ) ;
2018 console . dir ( args ) ;
2119 const result = fn ( ...args ) ;
22- console . log ( 'Ended wrapper for: ' + fn . name ) ;
20+ console . log ( 'Ended wrapper for:' , fn . name ) ;
2321 console . dir ( { result } ) ;
2422 return result ;
2523 } ;
You can’t perform that action at this time.
0 commit comments