refactor: rename internal variables#12894
Merged
kgryte merged 3 commits intoJun 15, 2026
Merged
Conversation
…uare/mean` Use the conventional `main` identifier when requiring `./main.js` in `lib/index.js` to match the pattern used by 11 of 14 sibling packages in `stats/base/dists/chisquare` (78%) and 401 of 505 packages across `stats/base/dists` overall (79%). Internal rename only; the public export is unchanged.
…uare/median` Use the conventional `main` identifier when requiring `./main.js` in `lib/index.js` to match the pattern used by 11 of 14 sibling packages in `stats/base/dists/chisquare` (78%) and 401 of 505 packages across `stats/base/dists` overall (79%). Internal rename only; the public export is unchanged.
…uare/mode` Use the conventional `main` identifier when requiring `./main.js` in `lib/index.js` to match the pattern used by 11 of 14 sibling packages in `stats/base/dists/chisquare` (78%) and 401 of 505 packages across `stats/base/dists` overall (79%). Internal rename only; the public export is unchanged.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
Jun 15, 2026
main.js imports in stats/base/dists/chisquare/{mean,median,mode}
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:
lib/index.jsimport binding instats/base/dists/chisquare/mean,stats/base/dists/chisquare/median, andstats/base/dists/chisquare/modefrom the function name to the conventionalmainidentifier, aligning the three packages with the majority convention in the namespace.Namespace summary
@stdlib/stats/base/dists/chisquarecdf,ctor,entropy,kurtosis,logpdf,mean,median,mgf,mode,pdf,quantile,skewness,stdev,variance)package.jsontop-level key set (100%),lib/main.jspresence (100%),lib/index.jsimport binding name (main, 78%),README.mdpresence (100%),examples/index.jspresence (100%),benchmark/benchmark.jspresence (100%).binding.gyp,manifest.json,lib/native.js,src/main.c,src/addon.c,test/test.native.js) at 71%; factory-pattern files (lib/factory.js,test/test.factory.js) at 36%;## C APIsREADME section at 71%. All track the package's mathematical/native-port status and are intentional rather than drift.Per outlier package
stats/base/dists/chisquare/meanRebinds the
require( './main.js' )import frommeantomaininlib/index.js. Eleven of the fourteen sibling packages in the namespace already use themainidentifier (78%); ecosystem-wide, 401 of 505stats/base/dists/**/lib/index.jsfiles do (79%). Internal-only rename; the public export and the entry-point identity are unchanged.stats/base/dists/chisquare/medianSame rebind in
median/lib/index.js. Testsrequire( './../lib' )and rebind the export to a localmediansymbol, so the internal identifier is invisible to consumers.stats/base/dists/chisquare/modeSame rebind in
mode/lib/index.js. Smoke-tested:mode(9)→7,mode(-1)→NaN,mode(NaN)→NaN.Validation
package.json/manifest.jsonshape, README headings, test/benchmark/example file naming).lib/main.jsandlib/index.jsper package.require( './../lib' )and do not depend on the internal binding name.module.exportsstill resolves to the same function object).stats/base/distspackages already usevar main = require( './main.js' );.stats/base/dists/chisquare/pdf#11634 — adds C forpdf); factory-pattern files (intentional, only function-generators have them); JSDocktyping asPositiveNumbervsNonNegativeNumber(reflects whetherk = 0is mathematically defined for the function).Related Issues
No.
Questions
No.
Other
Diff is 6 lines across 3 files (2 lines per package). Each correction is committed separately for a per-package audit trail.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running an automated cross-package drift-detection routine over the
stats/base/dists/chisquarenamespace. Author reviewed the diff before opening.@stdlib-js/reviewers
Generated by Claude Code