8000 Transform error messages · stdlib-js/ndarray-data-buffer@30b5592 · GitHub
[go: up one dir, main page]

Skip to content

Commit 30b5592

Browse files
committed
Transform error messages
1 parent 2f0c1a0 commit 30b5592

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 isCollection = require( '@stdlib/assert-is-collection' );
24-
var format = require( '@stdlib/string-format' );
24+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
2525

2626

2727
// MAIN //
@@ -48,14 +48,14 @@ function data( 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( '1kTDv', x ) );
5252
}
5353
out = x.data;
5454
if ( isCollection( out ) ) {
5555
return out;
5656
}
5757
// A data buffer is essential for operating on an ndarray object, so no fallbacks or workarounds for data buffer resolution...
58-
throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) );
58+
throw new TypeError( format( '1kTDv', x ) );
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/assert-is-collection": "^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