Skip to content

Commit f3ba2d3

Browse files
committed
fix: move options argument check to correct position
1 parent d68f17c commit f3ba2d3

File tree

1 file changed

+3
-3
lines changed
  • lib/node_modules/@stdlib/streams/node/from-constant/lib

1 file changed

+3
-3
lines changed

lib/node_modules/@stdlib/streams/node/from-constant/lib/factory.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ function factory( value, options ) {
8585
opts = assign( {}, value );
8686
FLG = true;
8787
} else {
88-
if ( !isObject( options ) ) {
89-
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
90-
}
9188
opts = {};
9289
}
9390
} else { // nargs > 1
91+
if ( !isObject( options ) ) {
92+
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
93+
}
9494
opts = assign( {}, options );
9595
}
9696
if ( FLG ) {

0 commit comments

Comments
 (0)