Skip to content

Commit 6afbec4

Browse files
committed
Auto-generated commit
1 parent 6fa61d4 commit 6afbec4

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

.github/.keepalive

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

lib/factory.js

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

2323
var isObject = require( '@stdlib/assert-is-plain-object' );
24+
var format = require( '@stdlib/string-format' );
2425
var copy = require( '@stdlib/utils-copy' );
2526
var Stream = require( './main.js' );
2627

@@ -57,7 +58,7 @@ function streamFactory( options ) {
5758
var opts;
5859
if ( arguments.length ) {
5960
if ( !isObject( options ) ) {
60-
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
61+
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
6162
}
6263
opts = copy( options );
6364
} else {

lib/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var InspectSinkStream = require( '@stdlib/streams-node-inspect-sink' );
2424
var isFunction = require( '@stdlib/assert-is-function' );
2525
var isBuffer = require( '@stdlib/assert-is-buffer' );
26+
var format = require( '@stdlib/string-format' );
2627
var copy = require( '@stdlib/utils-copy' );
2728
var inherit = require( '@stdlib/utils-inherit' );
2829
var debug = require( './debug.js' );
@@ -77,7 +78,7 @@ function DebugSinkStream( options, clbk ) {
7778
opts = copy( DEFAULTS );
7879
if ( arguments.length > 1 ) {
7980
if ( !isFunction( clbk ) ) {
80-
throw new TypeError( 'invalid argument. Callback argument must be a function. Value: `' + clbk + '`.' );
81+
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );
8182
}
8283
cb = clbk;
8384
err = validate( opts, options );

lib/object_mode.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
var isFunction = require( '@stdlib/assert-is-function' );
2424
var isObject = require( '@stdlib/assert-is-plain-object' );
25+
var format = require( '@stdlib/string-format' );
2526
var copy = require( '@stdlib/utils-copy' );
2627
var Stream = require( './main.js' );
2728

@@ -57,20 +58,20 @@ function objectMode( options, clbk ) {
5758
var cb;
5859
if ( arguments.length > 1 ) {
5960
if ( !isObject( options ) ) {
60-
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
61+
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
6162
}
6263
opts = copy( options );
6364
cb = clbk;
6465
if ( !isFunction( clbk ) ) {
65-
throw new TypeError( 'invalid argument. Callback argument must be a function. Value: `' + clbk + '`.' );
66+
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );
6667
}
6768
} else if ( arguments.length ) {
6869
if ( isFunction( options ) ) {
6970
opts = {};
7071
cb = options;
7172
} else {
7273
if ( !isObject( options ) ) {
73-
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
74+
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
7475
}
7576
opts = copy( options );
7677
}

0 commit comments

Comments
 (0)