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
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
Comment thread
kgryte marked this conversation as resolved.
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