File tree 4 files changed +8
-6
lines changed
4 files changed +8
-6
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 21
21
// MODULES //
22
22
23
23
var isObject = require ( '@stdlib/assert-is-plain-object' ) ;
24
+ var format = require ( '@stdlib/string-format' ) ;
24
25
var copy = require ( '@stdlib/utils-copy' ) ;
25
26
var Stream = require ( './main.js' ) ;
26
27
@@ -57,7 +58,7 @@ function streamFactory( options ) {
57
58
var opts ;
58
59
if ( arguments . length ) {
59
60
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 ) ) ;
61
62
}
62
63
opts = copy ( options ) ;
63
64
} else {
Original file line number Diff line number Diff line change 23
23
var InspectSinkStream = require ( '@stdlib/streams-node-inspect-sink' ) ;
24
24
var isFunction = require ( '@stdlib/assert-is-function' ) ;
25
25
var isBuffer = require ( '@stdlib/assert-is-buffer' ) ;
26
+ var format = require ( '@stdlib/string-format' ) ;
26
27
var copy = require ( '@stdlib/utils-copy' ) ;
27
28
var inherit = require ( '@stdlib/utils-inherit' ) ;
28
29
var debug = require ( './debug.js' ) ;
@@ -77,7 +78,7 @@ function DebugSinkStream( options, clbk ) {
77
78
opts = copy ( DEFAULTS ) ;
78
79
if ( arguments . length > 1 ) {
79
80
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 ) ) ;
81
82
}
82
83
cb = clbk ;
83
84
err = validate ( opts , options ) ;
Original file line number Diff line number Diff line change 22
22
23
23
var isFunction = require ( '@stdlib/assert-is-function' ) ;
24
24
var isObject = require ( '@stdlib/assert-is-plain-object' ) ;
25
+ var format = require ( '@stdlib/string-format' ) ;
25
26
var copy = require ( '@stdlib/utils-copy' ) ;
26
27
var Stream = require ( './main.js' ) ;
27
28
@@ -57,20 +58,20 @@ function objectMode( options, clbk ) {
57
58
var cb ;
58
59
if ( arguments . length > 1 ) {
59
60
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 ) ) ;
61
62
}
62
63
opts = copy ( options ) ;
63
64
cb = clbk ;
64
65
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 ) ) ;
66
67
}
67
68
} else if ( arguments . length ) {
68
69
if ( isFunction ( options ) ) {
69
70
opts = { } ;
70
71
cb = options ;
71
72
} else {
72
73
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 ) ) ;
74
75
}
75
76
opts = copy ( options ) ;
76
77
}
You can’t perform that action at this time.
0 commit comments