File tree Expand file tree Collapse file tree 4 files changed +5
-3
lines changed Expand file tree Collapse file tree 4 files changed +5
-3
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2121// MODULES //
2222
2323var isCollection = require ( '@stdlib/assert-is-collection' ) ;
24+ var format = require ( '@stdlib/string-format' ) ;
2425var Buffer = require ( '@stdlib/buffer-ctor' ) ;
2526
2627
@@ -41,7 +42,7 @@ var Buffer = require( '@stdlib/buffer-ctor' );
4142*/
4243function 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}
Original file line number Diff line number Diff line change 2121// MODULES //
2222
2323var isCollection = require ( '@stdlib/assert-is-collection' ) ;
24+ var format = require ( '@stdlib/string-format' ) ;
2425var Buffer = require ( '@stdlib/buffer-ctor' ) ;
2526
2627
@@ -41,7 +42,7 @@ var Buffer = require( '@stdlib/buffer-ctor' );
4142*/
4243function 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}
Original file line number Diff line number Diff line change 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" : {
You can’t perform that action at this time.
0 commit comments