Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f716e9b

Browse filesBrowse files
committed
Transform error messages
1 parent b0857bc commit f716e9b
Copy full SHA for f716e9b

File tree

3 files changed

+5
-5
lines changed
Filter options

3 files changed

+5
-5
lines changed

‎lib/main.js

Copy file name to clipboardExpand all lines: lib/main.js
+2-2Lines changed: 2 additions & 2 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
var Buffer = require( '@stdlib/buffer-ctor' );
2626

2727

@@ -42,7 +42,7 @@ var Buffer = require( '@stdlib/buffer-ctor' );
4242
*/
4343
function fromArray( arr ) {
4444
if ( !isCollection( arr ) ) {
45-
throw new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );
45+
throw new TypeError( format( '0GJ2u', arr ) );
4646
}
4747
return Buffer.from( arr );
4848
}

‎lib/polyfill.js

Copy file name to clipboardExpand all lines: lib/polyfill.js
+2-2Lines changed: 2 additions & 2 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
var Buffer = require( '@stdlib/buffer-ctor' );
2626

2727

@@ -42,7 +42,7 @@ var Buffer = require( '@stdlib/buffer-ctor' );
4242
*/
4343
function fromArray( arr ) {
4444
if ( !isCollection( arr ) ) {
45-
throw new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );
45+
throw new TypeError( format( '0GJ2u', arr ) );
4646
}
4747
return new Buffer( arr ); // eslint-disable-line no-buffer-constructor
4848
}

‎package.json

Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@stdlib/assert-is-collection": "^0.2.2",
4141
"@stdlib/assert-is-function": "^0.2.2",
4242
"@stdlib/buffer-ctor": "^0.2.2",
43-
"@stdlib/string-format": "^0.2.2",
43+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
4444
"@stdlib/types": "^0.4.1",
4545
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
4646
},

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.