File tree
Expand file treeCollapse file tree2 files changed
+4
-4
lines changed Expand file treeCollapse file tree2 files changed
+4
-4
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -24,7 +24,7 @@ var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).is
|
24 | 24 | var ctors = require( '@stdlib/array-ctors' );
|
25 | 25 | var gzeros = require( '@stdlib/array-base-zeros' );
|
26 | 26 | var defaults = require( '@stdlib/array-defaults' );
|
27 |
| -var format = require( '@stdlib/string-format' ); |
| 27 | +var format = require( '@stdlib/error-tools-fmtprodmsg' ); |
28 | 28 |
|
29 | 29 |
|
30 | 30 | // VARIABLES //
|
@@ -55,7 +55,7 @@ function zeros( length ) {
|
55 | 55 | var dtype;
|
56 | 56 | var ctor;
|
57 | 57 | if ( !isNonNegativeInteger( length ) ) {
|
58 |
| -throw new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', length ) ); |
| 58 | +throw new TypeError( format( '02Z2d', length ) ); |
59 | 59 | }
|
60 | 60 | if ( arguments.length > 1 ) {
|
61 | 61 | dtype = arguments[ 1 ];
|
@@ -67,7 +67,7 @@ function zeros( length ) {
|
67 | 67 | }
|
68 | 68 | ctor = ctors( dtype );
|
69 | 69 | if ( ctor === null ) {
|
70 |
| -throw new TypeError( format( 'invalid argument. Second argument must be a recognized data type. Value: `%s`.', dtype ) ); |
| 70 | +throw new TypeError( format( '02Z37', dtype ) ); |
71 | 71 | }
|
72 | 72 | return new ctor( length ); // WARNING: we assume that, apart from 'generic', the constructors for supported array data types are zero-filled by default
|
73 | 73 | }
|
|
Original file line number | Diff line number | Diff line change |
---|
|
41 | 41 | "@stdlib/array-ctors": "^0.2.1",
|
42 | 42 | "@stdlib/array-defaults": "^0.2.1",
|
43 | 43 | "@stdlib/assert-is-nonnegative-integer": "^0.2.1",
|
44 |
| -"@stdlib/string-format": "^0.2.1", |
| 44 | +"@stdlib/error-tools-fmtprodmsg": "^0.2.1", |
45 | 45 | "@stdlib/types": "^0.3.2",
|
46 | 46 | "@stdlib/error-tools-fmtprodmsg": "^0.2.1"
|
47 | 47 | },
|
|
You can’t perform that action at this time.
0 commit comments