Skip to content

Commit 536b703

Browse files
committed
Auto-generated commit
1 parent 748c967 commit 536b703

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// MODULES //
2222

2323
var isCollection = require( '@stdlib/assert-is-collection' );
24+
var format = require( '@stdlib/string-format' );
2425
var Buffer = require( '@stdlib/buffer-ctor' );
2526

2627

@@ -41,7 +42,7 @@ var Buffer = require( '@stdlib/buffer-ctor' );
4142
*/
4243
function fromArray( arr ) {
4344
if ( !isCollection( arr ) ) {
44-
throw new TypeError( 'invalid argument. Must provide an array-like object. Value: `' + arr + '`' );
45+
throw new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );
4546
}
4647
return Buffer.from( arr );
4748
}

lib/polyfill.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// MODULES //
2222

2323
var isCollection = require( '@stdlib/assert-is-collection' );
24+
var format = require( '@stdlib/string-format' );
2425
var Buffer = require( '@stdlib/buffer-ctor' );
2526

2627

@@ -41,7 +42,7 @@ var Buffer = require( '@stdlib/buffer-ctor' );
4142
*/
4243
function fromArray( arr ) {
4344
if ( !isCollection( arr ) ) {
44-
throw new TypeError( 'invalid argument. Must provide an array-like object. Value: `' + arr + '`' );
45+
throw new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );
4546
}
4647
return new Buffer( arr ); // eslint-disable-line no-buffer-constructor
4748
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@stdlib/assert-is-collection": "^0.0.x",
4141
"@stdlib/assert-is-function": "^0.0.x",
4242
"@stdlib/buffer-ctor": "^0.0.x",
43+
"@stdlib/string-format": "^0.0.x",
4344
"@stdlib/types": "^0.0.x"
4445
},
4546
"devDependencies": {

0 commit comments

Comments
 (0)