refactor: use main as require alias in stats/base/dists/frechet#12260
Merged
kgryte merged 3 commits intoMay 24, 2026
Conversation
Rename the `var` alias bound to `require( './main.js' )` in `lib/index.js` from `mean` to `main`, and update the matching `module.exports` assignment. Brings the package into line with the canonical wrapper-module pattern used by 11/14 (78.6%) of sibling packages under `stats/base/dists/frechet` and 78% of packages under `stats/base/dists` ecosystem-wide. Internal-only rename: the module's public export value is unchanged.
…dian` Rename the `var` alias bound to `require( './main.js' )` in `lib/index.js` from `median` to `main`, and update the matching `module.exports` assignment. Brings the package into line with the canonical wrapper-module pattern used by 11/14 (78.6%) of sibling packages under `stats/base/dists/frechet` and 78% of packages under `stats/base/dists` ecosystem-wide. Internal-only rename: the module's public export value is unchanged.
Rename the `var` alias bound to `require( './main.js' )` in `lib/index.js` from `mode` to `main`, and update the matching `module.exports` assignment. Brings the package into line with the canonical wrapper-module pattern used by 11/14 (78.6%) of sibling packages under `stats/base/dists/frechet` and 78% of packages under `stats/base/dists` ecosystem-wide. Internal-only rename: the module's public export value is unchanged.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
May 24, 2026
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
Normalizes the
require( './main.js' )alias in threelib/index.jsfiles understats/base/dists/frechetfrom the package-name form (e.g.var mean = ...) to the canonicalvar main = ...form, with matchingmodule.exportsupdates. Internal-only rename: the exported value is unchanged.Namespace summary
@stdlib/stats/base/dists/frechetpackage.jsonshape, README sections,lib/file set,lib/index.jsrequire-alias variable, error-construction shapelib/index.jsrequire-alias variable (11/14 = 78.6% usevar main)ctor,pdf) are intentional (constructor; trivialexp(logpdf(...))wrapper)Per outlier package
stats/base/dists/frechet/meanRenames the local alias in
lib/index.jsfrommeantomainto match the canonical wrapper-module convention used by the remaining sibling packages understats/base/dists/frechetand throughout thestats/base/distsecosystem. No functional changes; export behavior is unchanged.stats/base/dists/frechet/medianRenames the local alias in
lib/index.jsfrommediantomainto match the canonical wrapper-module convention used across thestats/base/distsecosystem. Purely cosmetic and does not affect the exported API or runtime behavior.stats/base/dists/frechet/modeRenames the local alias in
lib/index.jsfrommodetomainto align with the canonical wrapper-module convention used by 11 of 14 sibling packages understats/base/dists/frechetand approximately 78% of packages across thestats/base/distsecosystem. No functional changes; export behavior is unchanged.Related Issues
None.
Questions
No.
Other
Validation
package.json, README headings,lib/,test/,benchmark/,examples/, anddocs/trees.formatfor the one package that throws —ctor; the distribution functions returnNaNon invalid input).var mainalias is the canonical convention, and no test / example / downstream consumer reads the exports via a named property (.mean/.median/.mode).stats/base/dists/*/*/lib/index.jsfiles already usevar main, confirming this is the canonical convention and not a frechet-local style choice.Deliberately excluded
pdfpackage lacks native bindings and a## C APIsREADME section: intentional — the implementation isexp(logpdf(x, ...)), a one-line wrapper aroundlogpdf, so a native binding adds no value.ctorpackage has a distinct file tree (no native binding, nofactory.js, different README): legitimately different — it is a stateful distribution constructor, not a scalar function.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running a cross-package drift-detection routine: extract structural/semantic features from every package in a randomly chosen namespace, identify a ≥75% majority pattern per feature, validate with three independent review agents, and apply mechanical fixes to outliers. The scope here is a purely internal
varrename in threelib/index.jsfiles. A human maintainer should confirm and promote out of draft.@stdlib-js/reviewers
Generated by Claude Code