Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions lib/node_modules/@stdlib/_tools/github/get/lib/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,22 @@ function factory( options, clbk ) {
*/
function get() {
resolve( opts, done );
}

/**
* Callback invoked after resolving resources.
*
* @private
* @param {(Error|null)} error - error object
* @param {(ObjectArray|null)} data - query data
* @param {(Object|null)} info - response info
* @returns {void}
*/
function done( error, data, info ) {
error = error || null;
data = data || null;
info = info || null;
clbk( error, data, info );
}
/**
* Callback invoked after resolving resources.
*
* @private
* @param {(Error|null)} error - error object
* @param {(ObjectArray|null)} data - query data
* @param {(Object|null)} info - response info
* @returns {void}
*/
function done( error, data, info ) {
error = error || null;
data = data || null;
info = info || null;
clbk( error, data, info );
}
}

Expand Down
72 changes: 36 additions & 36 deletions lib/node_modules/@stdlib/repl/lib/commands/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,44 +70,44 @@
debug( 'Loading a file...' );
repl.load( fpath, clbk );
}
}

/**
* Callback invoked upon loading a file.
*
* @private
* @param {Error} [error] - error object
*/
function clbk( error ) {
var pos;
if ( error ) {
// NOTE: we can assume that the error pertains to actually reading the file (e.g., loading from disk) and NOT the line-by-line evaluation, where error handling should be handled separately...
debug( 'Error: %s', error.message );

// Infer the current cursor column position based on the length of the command prompt string:
pos = repl._prompt().length; // FIXME: how to address multi-column characters?

// FIXME: handle non-TTY output streams!

/*
* Print the error message on the previous line and generate the expected display prompt and cursor position.
*
* [ANSI escape sequences][1]:
*
* - `\u001b`: ESC, the escape character
* - `[1A`: move cursor up one line
* - `[nD`: move cursor back (to the left) `n` columns (cells)
* - `[0J`: clear the screen beginning from the current cursor position to the end of the screen
*
* [1]: https://en.wikipedia.org/wiki/ANSI_escape_code
*/
repl._ostream.write( '\u001b[1A\u001b['+pos+'DError: '+error.message+'\u001b[0J\n' );

// Show a new display prompt:
repl._displayPrompt();
return;
}
debug( 'Successfully loaded file.' );
/**
* Callback invoked upon loading a file.
*
* @private
* @param {Error} [error] - error object
*/
function clbk( error ) {
var pos;
if ( error ) {
// NOTE: we can assume that the error pertains to actually reading the file (e.g., loading from disk) and NOT the line-by-line evaluation, where error handling should be handled separately...
debug( 'Error: %s', error.message );

// Infer the current cursor column position based on the length of the command prompt string:
pos = repl._prompt().length; // FIXME: how to address multi-column characters?

Check warning on line 88 in lib/node_modules/@stdlib/repl/lib/commands/load.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: how to address multi-column...'

// FIXME: handle non-TTY output streams!

Check warning on line 90 in lib/node_modules/@stdlib/repl/lib/commands/load.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: handle non-TTY output streams!'

/*
* Print the error message on the previous line and generate the expected display prompt and cursor position.
*
* [ANSI escape sequences][1]:
*
* - `\u001b`: ESC, the escape character
* - `[1A`: move cursor up one line
* - `[nD`: move cursor back (to the left) `n` columns (cells)
* - `[0J`: clear the screen beginning from the current cursor position to the end of the screen
*
* [1]: https://en.wikipedia.org/wiki/ANSI_escape_code
*/
repl._ostream.write( '\u001b[1A\u001b['+pos+'DError: '+error.message+'\u001b[0J\n' );

// Show a new display prompt:
repl._displayPrompt();
return;
}
debug( 'Successfully loaded file.' );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ function command( pres ) {
*/
function onCommand() {
pres._repl.once( 'drain', onDrain ); // eslint-disable-line no-underscore-dangle
}

/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.firstFragment().show();
}
/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.firstFragment().show();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ function command( pres ) {
*/
function onCommand() {
pres._repl.once( 'drain', onDrain ); // eslint-disable-line no-underscore-dangle
}

/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.nextSlide().show();
}
/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.nextSlide().show();
}
}

Expand Down
16 changes: 8 additions & 8 deletions lib/node_modules/@stdlib/repl/presentation/lib/commands/prev.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ function command( pres ) {
*/
function onCommand() {
pres._repl.once( 'drain', onDrain ); // eslint-disable-line no-underscore-dangle
}

/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.prev().show();
}
/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.prev().show();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ function command( pres ) {
*/
function onCommand() {
pres._repl.once( 'drain', onDrain ); // eslint-disable-line no-underscore-dangle
}

/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.prevSlide().show();
}
/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.prevSlide().show();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ function command( pres ) {
*/
function onCommand() {
pres._repl.once( 'drain', onDrain ); // eslint-disable-line no-underscore-dangle
}

/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.show();
}
/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.show();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,41 +49,41 @@
*/
function onCommand() {
pres._repl.once( 'drain', onDrain );
}

/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
var pos;
try {
pres.reload().show();
} catch ( error ) {
debug( 'Error: %s', error.message );

// Infer the current cursor column position based on the length of the command prompt string:
pos = pres._repl._prompt().length; // FIXME: how to address multi-column characters?

// FIXME: handle non-TTY output streams!

/*
* Print the error message on the previous line and generate the expected display prompt and cursor position.
*
* [ANSI escape sequences][1]:
*
* - `\u001b`: ESC, the escape character
* - `[1A`: move cursor up one line
* - `[nD`: move cursor back (to the left) `n` columns (cells)
* - `[0J`: clear the screen beginning from the current cursor position to the end of the screen
*
* [1]: https://en.wikipedia.org/wiki/ANSI_escape_code
*/
pres._repl._ostream.write( '\u001b[1A\u001b['+pos+'DError: '+error.message+'\u001b[0J\n' );

// Show a new display prompt:
pres._repl._displayPrompt();
}
/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
var pos;
try {
pres.reload().show();
} catch ( error ) {
debug( 'Error: %s', error.message );

// Infer the current cursor column position based on the length of the command prompt string:
pos = pres._repl._prompt().length; // FIXME: how to address multi-column characters?

Check warning on line 67 in lib/node_modules/@stdlib/repl/presentation/lib/commands/reload_presentation.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: how to address multi-column...'

// FIXME: handle non-TTY output streams!

Check warning on line 69 in lib/node_modules/@stdlib/repl/presentation/lib/commands/reload_presentation.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: handle non-TTY output streams!'

/*
* Print the error message on the previous line and generate the expected display prompt and cursor position.
*
* [ANSI escape sequences][1]:
*
* - `\u001b`: ESC, the escape character
* - `[1A`: move cursor up one line
* - `[nD`: move cursor back (to the left) `n` columns (cells)
* - `[0J`: clear the screen beginning from the current cursor position to the end of the screen
*
* [1]: https://en.wikipedia.org/wiki/ANSI_escape_code
*/
pres._repl._ostream.write( '\u001b[1A\u001b['+pos+'DError: '+error.message+'\u001b[0J\n' );

// Show a new display prompt:
pres._repl._displayPrompt();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ function command( pres ) {
*/
function onCommand() {
pres._repl.once( 'drain', onDrain ); // eslint-disable-line no-underscore-dangle
}

/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.run( noop );
}
/**
* Callback invoked upon a `drain` event.
*
* @private
*/
function onDrain() {
pres.run( noop );
}
}

Expand Down
Loading