stdlib-js / utils-parse-json

@@ -22,6 +22,7 @@
Loading
22 22
23 23
var isString = require( '@stdlib/assert-is-string' ).isPrimitive;
24 24
var isFunction = require( '@stdlib/assert-is-function' );
25 +
var format = require( '@stdlib/string-format' );
25 26
26 27
27 28
// MAIN //
@@ -41,11 +42,11 @@
Loading
41 42
*/
42 43
function parseJSON( str, reviver ) {
43 44
	if ( !isString( str ) ) {
44 -
		throw new TypeError( 'invalid argument. First argument must be a string. Value: `' + str + '`.' );
45 +
		throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );
45 46
	}
46 47
	if ( arguments.length > 1 ) {
47 48
		if ( !isFunction( reviver ) ) {
48 -
			throw new TypeError( 'invalid argument. Reviver argument must be a function. Value: `' + reviver + '`.' );
49 +
			throw new TypeError( format( 'invalid argument. Reviver argument must be a function. Value: `%s`.', reviver ) );
49 50
		}
50 51
	}
51 52
	try {
Files Coverage
lib 100.00%
Project Totals (2 files) 100.00%
2139293876
unittests
2080826808
unittests
2211208088
unittests
2175409321
unittests
2248842891
unittests

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading