stdlib-js / stats-ranks

Compare c1b6ca4 ... +0 ... 60ff10a

Coverage Reach

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.

Showing 1 of 1 files from the diff.

@@ -25,6 +25,7 @@
Loading
25 25
var isObject = require( '@stdlib/assert-is-object' );
26 26
var isString = require( '@stdlib/assert-is-string' ).isPrimitive;
27 27
var hasOwnProp = require( '@stdlib/assert-has-own-property' );
28 +
var format = require( '@stdlib/string-format' );
28 29
29 30
30 31
// VARIABLES //
@@ -48,24 +49,24 @@
Loading
48 49
*/
49 50
function validate( opts, options ) {
50 51
	if ( !isObject( options ) ) {
51 -
		return new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
52 +
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
52 53
	}
53 54
	if ( hasOwnProp( options, 'encoding' ) ) {
54 55
		opts.encoding = options.encoding;
55 56
		if ( !isArray( opts.encoding ) ) {
56 -
			return new TypeError( 'invalid option. `encoding` option must be an array. Option: `' + opts.encoding + '`.' );
57 +
			return new TypeError( format( 'invalid option. `%s` option must be an array. Option: `%s`.', 'encoding', opts.encoding ) );
57 58
		}
58 59
	}
59 60
	if ( hasOwnProp( options, 'method' ) ) {
60 61
		opts.method = options.method;
61 62
		if ( !isString( opts.method ) || !contains( METHODS, opts.method ) ) {
62 -
			return new TypeError( 'invalid option. `method` must be one of the following values: `average`, `min`, `max`, `dense`, or `ordinal`. Option: `' + opts.method + '`.' );
63 +
			return new TypeError( format( 'invalid option. `%s` must be one of the following: %s. Option: `%s`.', 'method', METHODS.join( ',' ), opts.method ) );
63 64
		}
64 65
	}
65 66
	if ( hasOwnProp( options, 'missing' ) ) {
66 67
		opts.missing = options.missing;
67 68
		if ( !isString( opts.missing ) || !contains( MISSING, opts.missing ) ) {
68 -
			return new TypeError( 'invalid option. `missing` must be one of the following values: `last`, `first`, or `remove`. Option: `' + opts.missing + '`.' );
69 +
			return new TypeError( format( 'invalid option. `%s` must be one of the following: %s. Option: `%s`.', 'missing', MISSING.join( ',' ), opts.missing ) );
69 70
		}
70 71
	}
71 72
	return null;

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
lib +<.01% 99.36%
Project Totals (6 files) 99.36%
Loading