stdlib-js / utils-inherit

@@ -21,6 +21,7 @@
Loading
21 21
// MODULES //
22 22
23 23
var defineProperty = require( '@stdlib/utils-define-property' );
24 +
var format = require( '@stdlib/string-format' );
24 25
var validate = require( './validate.js' );
25 26
var createObject = require( './detect.js' );
26 27
@@ -71,7 +72,7 @@
Loading
71 72
		throw err;
72 73
	}
73 74
	if ( typeof superCtor.prototype === 'undefined' ) {
74 -
		throw new TypeError( 'invalid argument. Second argument must have a prototype from which another object can inherit. Value: `'+superCtor.prototype+'`.' );
75 +
		throw new TypeError( format( 'invalid argument. Second argument must have a prototype from which another object can inherit. Value: `%s`.', superCtor.prototype ) );
75 76
	}
76 77
	// Create a prototype which inherits from the parent prototype:
77 78
	ctor.prototype = createObject( superCtor.prototype );

@@ -18,6 +18,13 @@
Loading
18 18
19 19
'use strict';
20 20
21 +
// MODULES //
22 +
23 +
var format = require( '@stdlib/string-format' );
24 +
25 +
26 +
// MAIN //
27 +
21 28
/**
22 29
* Tests that a value is a valid constructor.
23 30
*
@@ -40,7 +47,7 @@
Loading
40 47
		value === null ||
41 48
		(type !== 'object' && type !== 'function')
42 49
	) {
43 -
		return new TypeError( 'invalid argument. A provided constructor must be either an object (except null) or a function. Value: `'+value+'`.' );
50 +
		return new TypeError( format( 'invalid argument. A provided constructor must be either an object (except null) or a function. Value: `%s`.', value ) );
44 51
	}
45 52
	return null;
46 53
}
Files Coverage
lib 100.00%
Project Totals (6 files) 100.00%
2080735328
unittests
2076537955
unittests
2175323599
unittests
2139198484
unittests
2248762826
unittests
2211075006
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