Skip to content

Commit 492abd3

Browse files
committed
refactor: convert defaults module to JSON in streams/node/join
Aligns `streams/node/join` with the sibling-package convention: 12/16 (75%) of `streams/node/*` packages with configurable options expose defaults via a `lib/defaults.json` file and consume them with `assign( {}, DEFAULTS )`. `join` was the lone outlier carrying an equivalent `lib/defaults.js` function that returned a static object literal — no dynamism, no semantic difference. - Adds `lib/defaults.json` mirroring the literal returned by the removed `lib/defaults.js`. - Removes `lib/defaults.js`. - Updates `lib/main.js` to require the JSON file and use `@stdlib/object/assign` for a fresh copy, matching the pattern in `from-array`, `from-iterator`, `split`, and other siblings. No change to observable behavior, public API, or test expectations.
1 parent 58bbb07 commit 492abd3

3 files changed

Lines changed: 10 additions & 48 deletions

File tree

lib/node_modules/@stdlib/streams/node/join/lib/defaults.js

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"objectMode": false,
3+
"encoding": null,
4+
"allowHalfOpen": false,
5+
"readableObjectMode": false,
6+
"sep": "\n"
7+
}

lib/node_modules/@stdlib/streams/node/join/lib/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ var Buffer = require( '@stdlib/buffer/ctor' );
2727
var setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );
2828
var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
2929
var nextTick = require( '@stdlib/utils/next-tick' );
30-
var defaults = require( './defaults.js' );
30+
var assign = require( '@stdlib/object/assign' );
31+
var DEFAULTS = require( './defaults.json' );
3132
var validate = require( './validate.js' );
3233
var debug = require( './debug.js' );
3334

@@ -163,7 +164,7 @@ function JoinStream( options ) {
163164
}
164165
return new JoinStream();
165166
}
166-
opts = defaults();
167+
opts = assign( {}, DEFAULTS );
167168
if ( arguments.length ) {
168169
err = validate( opts, options );
169170
if ( err ) {

0 commit comments

Comments
 (0)