Skip to content

Commit 987f8cd

Browse files
committed
Auto-generated commit
1 parent 12beda2 commit 987f8cd

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;
2424
var ctors = require( '@stdlib/array-ctors' );
2525
var gzeros = require( '@stdlib/array-base-zeros' );
26+
var format = require( '@stdlib/string-format' );
2627

2728

2829
// MAIN //
@@ -48,7 +49,7 @@ function zeros( length ) {
4849
var dtype;
4950
var ctor;
5051
if ( !isNonNegativeInteger( length ) ) {
51-
throw new TypeError( 'invalid argument. First argument must be a nonnegative integer. Value: `' + length + '`.' );
52+
throw new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', length ) );
5253
}
5354
if ( arguments.length > 1 ) {
5455
dtype = arguments[ 1 ];
@@ -60,7 +61,7 @@ function zeros( length ) {
6061
}
6162
ctor = ctors( dtype );
6263
if ( ctor === null ) {
63-
throw new TypeError( 'invalid argument. Second argument must be a recognized data type. Value: `' + dtype + '`.' );
64+
throw new TypeError( format( 'invalid argument. Second argument must be a recognized data type. Value: `%s`.', dtype ) );
6465
}
6566
return new ctor( length ); // WARNING: we assume that, apart from 'generic', the constructors for supported array data types are zero-filled by default
6667
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@stdlib/array-base-zeros": "^0.0.x",
4141
"@stdlib/array-ctors": "^0.0.x",
4242
"@stdlib/assert-is-nonnegative-integer": "^0.0.x",
43+
"@stdlib/string-format": "^0.0.x",
4344
"@stdlib/types": "^0.0.x"
4445
},
4546
"devDependencies": {

0 commit comments

Comments
 (0)