Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ var t = table();
<!-- eslint no-undef: "error" -->

```javascript
var format = require( '@stdlib/string/format' );
var capitalize = require( '@stdlib/string/capitalize' );
var table = require( '@stdlib/datasets/us-states-names-capitals' );

Expand All @@ -123,7 +124,7 @@ function getCapital( state ) {

// Ensure a valid state name was provided...
if ( capital === void 0 ) {
throw new Error( 'unrecognized state name. Value: `' + state + '`.' );
throw new Error( format( 'unrecognized state name. Value: `%s`.', state ) );
}
return capital;
}
Expand Down
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aniket-SS This looks good. Would you mind also updating the corresponding example in the README? Cheers!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

'use strict';

var format = require( '@stdlib/string/format' );
var capitalize = require( '@stdlib/string/capitalize' );
var table = require( './../lib' );

Expand All @@ -38,7 +39,7 @@ function getCapital( state ) {

// Ensure a valid state name was provided...
if ( capital === void 0 ) {
throw new Error( 'unrecognized state name. Value: `' + state + '`.' );
throw new Error( format( 'unrecognized state name. Value: `%s`.', state ) );
}
return capital;
}
Expand Down