docs: document short-circuit early-return#12384
Merged
Merged
Conversation
Populate the previously empty `<section class="notes">` block in the README to describe the short-circuit return upon encountering a truthy iterated value. 54/65 (83%) of sibling `iter/*` packages populate this section, and `docs/repl.txt` already documents the same behavior with identical wording. The corresponding `iter/any-by` README documents the analogous predicate-driven behavior.
Populate the previously empty `<section class="notes">` block in the README to describe the short-circuit return upon encountering a falsy iterated value. 54/65 (83%) of sibling `iter/*` packages populate this section, and `docs/repl.txt` already documents the same behavior with identical wording. The corresponding `iter/every-by` README documents the analogous predicate-driven behavior.
Populate the previously empty `<section class="notes">` block in the README to describe the short-circuit return upon encountering a truthy iterated value. 54/65 (83%) of sibling `iter/*` packages populate this section, and `docs/repl.txt` already documents the same behavior with identical wording. The corresponding `iter/none-by` README documents the analogous predicate-driven behavior.
Populate the previously empty `<section class="notes">` block in the README to describe the short-circuit return upon finding `n` truthy iterated values. 54/65 (83%) of sibling `iter/*` packages populate this section, and `docs/repl.txt` already documents the same behavior with identical wording. The corresponding `iter/some-by` README documents the analogous predicate-driven behavior.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
May 31, 2026
@stdlib/iter READMEs
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 populates an empty
<section class="notes">wrapper in four@stdlib/iterpackage READMEs:iter/any,iter/every,iter/none, anditer/some. Each wrapper was present but contained no## Notesheading or body; the bullet added to each describes the short-circuit early-return behavior implemented inlib/main.js. Wording is taken verbatim from each package's existingdocs/repl.txt, so the REPL docs and README now agree.Namespace summary
@stdlib/iterpackage.jsonshape, README section structure,lib/index.jsshape, JSDoc presence, error construction stylepackage.jsontop-level keys (100%),package.json.directories/engines/os/license/main/typesvalues (100%),## Usage(100%),## Examples(100%),## See Also(85%),## Notes(83%),lib/index.jsshape (100%), error construction (100% conformant once static vs. interpolated messages are distinguished)### subsectionheadings (package-specific), JSDoc@throwsmessage phrasing (largest cluster is 22/65 — no convention reaches threshold)Per outlier package
@stdlib/iter/anyThe
<section class="notes">block was empty.iterAnyshort-circuits atlib/main.js:54-56, returningtrueon the first truthy iterated value.docs/repl.txtalready documents this with the same wording added here. 54/65 (83%) ofiter/*siblings populate this section, anditer/any-bydocuments the analogous predicate-driven behavior.@stdlib/iter/everyiterEveryshort-circuits atlib/main.js:54-56, returningfalseon the first falsy iterated value. README Notes section was empty; bullet text matchesdocs/repl.txtverbatim. 54/65 (83%) sibling conformance;iter/every-bydocuments the analogous predicate behavior.@stdlib/iter/noneiterNoneshort-circuits atlib/main.js:54-56, returningfalseon the first truthy iterated value. README Notes section was empty; bullet text matchesdocs/repl.txtverbatim. 54/65 (83%) sibling conformance;iter/none-bydocuments the analogous predicate behavior.@stdlib/iter/someiterSomeshort-circuits atlib/main.js:62-66, returningtrueoncentruthy values have been counted. README Notes section was empty; bullet text matchesdocs/repl.txtverbatim ("findingntruthy values"). 54/65 (83%) sibling conformance;iter/some-bydocuments the analogous predicate behavior.Validation
Each correction was validated by three independent agents per the drift-detection routine:
lib/main.jsto confirm the documented short-circuit behavior is present in code and that the proposed wording faithfully describes it.docs/repl.txtfor all four packages already contains the exact target wording.<section class="notes">wrapper, the populated-bysiblings as reference, and the stdlib bullet convention (-, backticked variable names).All four corrections received
confirmed-driftfrom all three agents.Deliberately excluded from this PR:
## See Alsooutliers (10 packages) — auto-populated by the package generator and outside hand-editing scope.## Notesfor cumulative variants (cuany,cuevery,cunone,cusome) — these do not short-circuit, so the-bysibling wording does not apply.## Notesforlast,length,nth— no sibling pattern provides correct, mechanically-derivable content.@throwsmessage normalization — no single phrasing crosses the 75% majority threshold.Related Issues
No.
Questions
No.
Other
The four bullets added are identical in form to those already present in the
-bysiblings (any-by,every-by,none-by,some-by), adjusted from "return value" to direct value-test wording to match how the non-predicate variants operate. The exact wording was taken from each package's owndocs/repl.txt, so the change brings the README and REPL docs into agreement rather than introducing new copy.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code as part of an automated cross-package drift-detection routine over the
@stdlib/iternamespace. The routine extracted structural and semantic features from each member package, identified majority patterns, gated out generator-owned sections and content-bearing deltas, and applied a three-agent review (two opus, one sonnet) before any patch was applied. The four edits in this PR are README-only and align with text already present in each package'sdocs/repl.txt.@stdlib-js/reviewers
Generated by Claude Code