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

Skip to content

Commit 33e12a6

Browse files
committed
Transform error messages
1 parent fd47ed6 commit 33e12a6

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
@@ -21,7 +21,7 @@
2121
// MODULES //
2222

2323
var isDataType = require( '@stdlib/ndarray-base-assert-is-data-type' );
24-
var format = require( '@stdlib/string-format' );
24+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
2525

2626

2727
// MAIN //
@@ -48,14 +48,14 @@ function dtype( x ) {
4848

4949
// Note: we intentionally avoid rigorous ndarray checks to minimize performance impacts. This obviously means that non-ndarray-like objects can sneak through, but this is likely all right for the purposes of this function...
5050
if ( typeof x !== 'object' || x === null ) {
51-
throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) );
51+
throw new TypeError( format( '1kVDv', x ) );
5252
}
5353
dt = x.dtype;
5454
if ( isDataType( dt ) ) {
5555
return dt;
5656
}
5757
// A data type is essential for interpreting the memory associated with an ndarray object, so no fallbacks or workarounds for data type resolution...
58-
throw new TypeError( format( 'invalid argument. Must provide an ndarray having a supported data type. Value: `%s`.', dt ) );
58+
throw new TypeError( format( '1kVF6', dt ) );
5959
}
6060

6161

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"dependencies": {
4040
"@stdlib/ndarray-base-assert-is-data-type": "^0.2.2",
41-
"@stdlib/string-format": "^0.2.2",
41+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
4242
"@stdlib/types": "^0.4.3",
4343
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
4444
},

0 commit comments

Comments
 (0)
0