Skip to content

Commit fcd30df

Browse files
authored
refactor: move function to correct scope
Signed-off-by: Athan <kgryte@gmail.com>
1 parent 602937b commit fcd30df

1 file changed

Lines changed: 14 additions & 30 deletions

File tree

  • lib/node_modules/@stdlib/repl/presentation/lib/commands

lib/node_modules/@stdlib/repl/presentation/lib/commands/blank.js

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,28 @@
2525
var repeat = require( '@stdlib/string/repeat' );
2626

2727

28-
// FUNCTIONS //
28+
// MAIN //
2929

3030
/**
31-
* Returns a callback to be invoked upon a `drain` event.
31+
* Returns a callback to be invoked upon calling the `blank` command.
3232
*
3333
* @private
3434
* @param {Presentation} pres - presentation instance
3535
* @returns {Function} callback
3636
*/
37-
function createDrainHandler( pres ) {
38-
return onDrain;
37+
function command( pres ) {
38+
return onCommand;
3939

40+
/**
41+
* Prints a "blank" slide.
42+
*
43+
* @private
44+
*/
45+
function onCommand() {
46+
var str = repeat( pres._opts.newline, pres.height+1 );
47+
pres._repl._ostream.write( str );
48+
pres._repl.once( 'drain', onDrain );
49+
}
4050
/**
4151
* Callback invoked upon a `drain` event.
4252
*
@@ -58,32 +68,6 @@ function createDrainHandler( pres ) {
5868
}
5969

6070

61-
// MAIN //
62-
63-
/**
64-
* Returns a callback to be invoked upon calling the `blank` command.
65-
*
66-
* @private
67-
* @param {Presentation} pres - presentation instance
68-
* @returns {Function} callback
69-
*/
70-
function command( pres ) {
71-
return onCommand;
72-
73-
/**
74-
* Prints a "blank" slide.
75-
*
76-
* @private
77-
*/
78-
function onCommand() {
79-
var str = repeat( pres._opts.newline, pres.height+1 );
80-
pres._repl._ostream.write( str );
81-
82-
pres._repl.once( 'drain', createDrainHandler( pres ) );
83-
}
84-
}
85-
86-
8771
// EXPORTS //
8872

8973
module.exports = command;

0 commit comments

Comments
 (0)