8000 Transform error messages · stdlib-js/ndarray-fill@f2a38a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit f2a38a6

Browse files
committed
Transform error messages
1 parent 79e1f0e commit f2a38a6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var isndarrayLike = require( '@stdlib/assert-is-ndarray-like' );
2424
var isReadOnly = require( '@stdlib/ndarray-base-assert-is-read-only' );
2525
var base = require( '@stdlib/ndarray-base-fill' );
26-
var format = require( '@stdlib/string-format' );
26+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
2727

2828

2929
// MAIN //
@@ -53,10 +53,10 @@ var format = require( '@stdlib/string-format' );
5353
*/
5454
function fill( x, value ) {
5555
if ( !isndarrayLike( x ) ) {
56-
throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
56+
throw new TypeError( format( 'null5t', x ) );
5757
}
5858
if ( isReadOnly( x ) ) {
59-
throw new Error( 'invalid argument. Cannot write to a read-only array.' );
59+
throw new Error( format('nullEs') );
6060
}
6161
base( x, value );
6262
return x;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@stdlib/assert-is-ndarray-like": "^0.2.2",
4141
"@stdlib/ndarray-base-assert-is-read-only": "^0.2.2",
4242
"@stdlib/ndarray-base-fill": "github:stdlib-js/ndarray-base-fill#main",
43-
"@stdlib/string-format": "^0.2.2",
43+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
4444
"@stdlib/types": "^0.4.3",
4545
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
4646
},

0 commit comments

Comments
 (0)
0