File tree Expand file tree Collapse file tree
lib/node_modules/@stdlib/repl/presentation/lib/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525var 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
8973module . exports = command ;
You can’t perform that action at this time.
0 commit comments