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

Skip to content

Commit ab516cd

Browse files
committed
Transform error messages
1 parent 43aac3b commit ab516cd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/main.js

Lines changed: 4 additions &a 8000 mp; 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var isndarrayLike = require( '@stdlib/assert-is-ndarray-like' );
2424
var isReadOnly = require( '@stdlib/ndarray-base-assert-is-read-only' );
2525
var isFunction = require( '@stdlib/assert-is-function' );
2626
var base = require( '@stdlib/ndarray-base-fill-by' );
27-
var format = require( '@stdlib/string-format' );
27+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
2828

2929

3030
// MAIN //
@@ -59,13 +59,13 @@ var format = require( '@stdlib/string-format' );
5959
*/
6060
function fillBy( x, fcn, thisArg ) {
6161
if ( !isndarrayLike( x ) ) {
62-
throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
62+
throw new TypeError( format( 'null5t', x ) );
6363
}
6464
if ( isReadOnly( x ) ) {
65-
throw new Error( 'invalid argument. Cannot write to a read-only array.' );
65+
throw new Error( format('nullEs') );
6666
}
6767
if ( !isFunction( fcn ) ) {
68-
throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );
68+
throw new TypeError( format( 'null2H', fcn ) );
6969
}
7070
base( x, fcn, thisArg );
7171
return x;

package.json

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

0 commit comments

Comments
 (0)
0