Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Mar 28, 2024
1 parent c5bbc39 commit 3761a22
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions lib/commands/rerun.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,22 @@ function command( repl ) {
return;
}
nargs = arguments.length;
if ( isString( arg ) ) {
FLG = 1;
} else if ( isNonNegativeInteger( arg ) ) {
FLG = 2;
} else if ( isRegExp( arg ) ) {
FLG = 3;
} else if ( isNonNegativeIntegerArray( arg ) ) {
FLG = 4;
} else {
err = new TypeError( format( 'invalid argument. Must provide a string, regular expression, nonnegative integer, or an array of nonnegative integers. Value: `%s`.', arg ) );
debug( 'Error: %s', err.message );
repl._ostream.write( 'Error: '+err.message+'\n' );
return;
if ( nargs > 0 ) {
if ( isString( arg ) ) {
FLG = 1;
} else if ( isNonNegativeInteger( arg ) ) {
FLG = 2;
} else if ( isRegExp( arg ) ) {
FLG = 3;
} else if ( isNonNegativeIntegerArray( arg ) ) {
FLG = 4;
} else {
err = new TypeError( format( 'invalid argument. Must provide a string, regular expression, nonnegative integer, or an array of nonnegative integers. Value: `%s`.', arg ) );
debug( 'Error: %s', err.message );
repl._ostream.write( 'Error: '+err.message+'\n' );
return;
}
}

// Why defer? In order to allow the `rerun()` command to finish before actually evaluating the commands to rerun, thus ensuring that commands are run as if a user manually enters them...
repl.once( 'drain', onFinish );

Expand Down

0 comments on commit 3761a22

Please sign in to comment.