refactor: convert defaults.js to defaults.json in streams/node/join#12303
Closed
Planeshifter wants to merge 1 commit into
Closed
refactor: convert defaults.js to defaults.json in streams/node/join#12303Planeshifter wants to merge 1 commit into
defaults.js to defaults.json in streams/node/join#12303Planeshifter wants to merge 1 commit into
Conversation
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.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
requested changes
May 27, 2026
Member
kgryte
left a comment
There was a problem hiding this comment.
This PR is not necessary. If anything, we should update the other packages to use a defaults.js file which exports a function return an object containing defaults.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request:
@stdlib/streams/node/joinfrom a function-formlib/defaults.jsto a flatlib/defaults.jsonfile, matching the convention used by the majority of sibling packages understreams/node/*.Namespace summary
Surveyed
@stdlib/streams/node/*(16 non-autogenerated members). Features analyzed: file tree,package.jsonshape, README section structure, validation prologue, error-construction style, default-options module shape. Features with a clear majority (≥75%): file-tree skeleton (lib/main.js,lib/index.js,lib/validate.js,lib/factory.js,lib/object_mode.js,lib/defaults.json,docs/repl.txt, etc.),package.jsontop-level key set, error construction via@stdlib/string/format(13/13 packages withvalidate.js),isPlainObjectfirst-check in validation prologues (13/13). Features without a clear majority (excluded): README h2Notessection (10/16), CLI section (2/16).@stdlib/streams/node/joinConverts
lib/defaults.js(a function returning a static object literal) tolib/defaults.json, aligning with the convention used by 12 of 16 configurablestreams/node/*packages. The removed function introduced no dynamism — all five defaults were primitives fixed at declaration time.lib/main.jsis updated torequire('./defaults.json')and initialize options viaassign({}, DEFAULTS).Validation
package.jsonkeys, README headings,test//benchmark//examples/file names) across all 16 members.confirmed-driftfor thejoincorrection.stderr,stdin,stdout(singleton re-exports ofprocess.*with no configurable options — legitimate absence ofdefaults.json,validate.js,factory.js);transform's per-moduledebugloggers (intentional design — four distinctdebugnamespaces, not a single shared logger); the READMESee Alsosection (auto-populated by the package generator); benchmarkbenchmark.throughput.jsforempty(semantically empty stream — synthesis requires package-specific knowledge).Related Issues
No.
Questions
No.
Other
Total diff: 3 files (+10/−48). No change to observable behavior, public API surface, or test expectations — the removed
defaults()function returned{ objectMode: false, encoding: null, allowHalfOpen: false, readableObjectMode: false, sep: '\n' }on every call, exactly the contents of the newlib/defaults.json.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was produced by a cross-package drift-detection routine running on Claude Code. The routine surveyed structural and semantic features across all 16
streams/node/*packages, identified the majority pattern per feature (≥75% threshold), and ran three independent validation agents per outlier before proposing a fix. The mechanical edit, commit, and PR body were authored by the agent under human direction; a maintainer should promote the draft only after independent review.@stdlib-js/reviewers
Generated by Claude Code