File tree Expand file tree Collapse file tree
lib/node_modules/@stdlib/datasets/us-states-names-capitals Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ var t = table();
103103<!-- eslint no-undef: "error" -->
104104
105105``` javascript
106+ var format = require ( ' @stdlib/string/format' );
106107var capitalize = require ( ' @stdlib/string/capitalize' );
107108var table = require ( ' @stdlib/datasets/us-states-names-capitals' );
108109
@@ -123,7 +124,7 @@ function getCapital( state ) {
123124
124125 // Ensure a valid state name was provided...
125126 if ( capital === void 0 ) {
126- throw new Error ( ' unrecognized state name. Value: `' + state + ' `. ' );
127+ throw new Error ( format ( ' unrecognized state name. Value: `%s`. ' , state ) );
127128 }
128129 return capital;
129130}
Original file line number Diff line number Diff line change 1818
1919'use strict' ;
2020
21+ var format = require ( '@stdlib/string/format' ) ;
2122var capitalize = require ( '@stdlib/string/capitalize' ) ;
2223var table = require ( './../lib' ) ;
2324
@@ -38,7 +39,7 @@ function getCapital( state ) {
3839
3940 // Ensure a valid state name was provided...
4041 if ( capital === void 0 ) {
41- throw new Error ( 'unrecognized state name. Value: `' + state + '`.' ) ;
42+ throw new Error ( format ( 'unrecognized state name. Value: `%s`.' , state ) ) ;
4243 }
4344 return capital ;
4445}
You can’t perform that action at this time.
0 commit comments