Skip to content

chore: fix typo in interface name and error message in two regexp/* packages#12445

Open
Planeshifter wants to merge 2 commits into
developfrom
philipp/drift-regexp-2026-06-02
Open

chore: fix typo in interface name and error message in two regexp/* packages#12445
Planeshifter wants to merge 2 commits into
developfrom
philipp/drift-regexp-2026-06-02

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

This pull request corrects two unintentional drifts in @stdlib/regexp/* flagged by a cross-package drift audit over the 27 non-autogenerated members of the namespace: a copy-paste interface name in regexp/regexp's TypeScript declaration, and a double-space typo in regexp/dirname's error-message format string. Both fixes are purely textual; neither changes observable runtime behavior beyond the literal error.message text in dirname.

Namespace summary

  • Members analyzed: 27 leaf packages under lib/node_modules/@stdlib/regexp/.
  • Features with a clear majority (≥75%) considered for correction: file tree, package.json shape, directories keys, README ## section set, error-construction style, validation prologues, JSDoc shape, and TypeScript interface naming.
  • Features without a clear majority (excluded from drift analysis): lib/regexp.js / test/test.regexp.js presence (20/27 = 74%, just under threshold), ## Notes README section (11/27 = 41%).
  • Features confirmed drift-free: every package shares an identical package.json top-level key set, identical directories map, and format-based error construction. No package constructs errors via concatenation or plain strings.

regexp/regexp

Rename the TypeScript interface in docs/types/index.d.ts from ReNativeFunction (a copy-paste leftover from regexp/native-function) to ReRegExp, conforming to the namespace-wide Re<PascalCasedPackageName> convention followed by 26 of 27 sibling packages (96%). The change is confined to docs/types/index.d.ts; docs/types/test.ts does not reference the interface by name, no other file in the repository imports it, and TypeScript interface names carry no runtime effect.

regexp/dirname

Collapsed a double space in the format template at lib/main.js:53 so the error message reads 'invalid argument. Must be one of the following...'. Brings the package in line with its siblings basename, extname, and filename, which were already single-spaced; grep confirms regexp/dirname was the sole occurrence of "invalid argument. Must" across the entire stdlib .js corpus (100% of siblings conform). No test or doc churn — nothing pins the exact message text.

Validation

  • Structural extraction over all 27 members: file tree, package.json keys/scripts/directories, README ## headings, error-construction style.
  • Semantic extraction over the four platform-dispatch packages (basename, dirname, extname, filename) and the three options-taking packages (decimal-number, eol, whitespace).
  • Three-agent drift validation (semantic-review, cross-reference, structural-review) confirmed confirmed-drift for both outliers; no outlier was marked intentional-deviation, needs-human, or insufficient-evidence.

Deliberately excluded:

  • ## See Also README drift in five packages (color-hexadecimal, decimal-number, duration-string, eol, extended-length-path) — gated as auto-populated by the package-generator.
  • Missing test/test.main.js in reviver and to-json — flagged in a prior audit as an intentional architectural deviation (those packages' lib/index.js are pure pass-throughs with no platform dispatch, so a separate test.main.js would only duplicate test.js).
  • lib/regexp.js / test/test.regexp.js extraction pattern (20/27, just under the 75% threshold) — leaf packages without a separate file inline their regex into main.js, which is a deliberate organizational choice rather than drift.

Related Issues

This pull request has no related issues.

Questions

No.

Other

Drift candidates produced by an automated cross-package audit; corrections were applied only after all three reviewer agents (semantic, cross-reference, structural) returned confirmed-drift. The materiality, auto-populated-section, ecosystem-wide-absence, and open-PR-collision gates were checked before validation. A previous drift PR on this namespace (#12363, merged 2026-05-30) addressed a separate README.md typo in regexp/dirname and is not duplicated here.

Checklist

AI Assistance

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This PR was authored by Claude Code as part of an automated cross-package drift detection routine over @stdlib/regexp/*. Three independent reviewer agents (semantic, cross-reference, structural) confirmed both candidates before the fixes were applied. A maintainer should promote out of draft after review.


@stdlib-js/reviewers


Generated by Claude Code

claude added 2 commits June 2, 2026 12:23
…gexp`

Renamed `interface ReNativeFunction` to `interface ReRegExp` in
`docs/types/index.d.ts` (and the corresponding `declare var` type
annotation). The previous name was a copy-paste leftover from
`@stdlib/regexp/native-function`; the JSDoc immediately above the
interface correctly describes parsing a regular expression string.

Conformance with the namespace-wide `Re<PascalCasedPackageName>`
interface-naming convention: 26 of 27 sibling packages (96%);
`regexp/regexp` was the lone outlier. The change is local to the
declaration file — `docs/types/test.ts` does not reference the name
and no other file in the repository imports the interface, so the
rename has no runtime effect.
Removed the double space after `argument.` in the `format` template
string at `lib/main.js:53` (`'invalid argument.  Must be one of the
following: "%s". Value: \`%s\`.'`). The three sibling platform-dispatch
packages (`basename`, `extname`, `filename`) all use a single space in
the equivalent line, and a stdlib-wide grep for `"invalid argument.  Must"`
returns this file as the sole occurrence.

Conformance with the single-space convention: 100% of stdlib `.js`
sources outside this file. No tests or docs assert the exact error
message text, so the one-character fix has no test impact.
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
regexp/dirname $\color{green}132/132$
$\color{green}+100.00\%$
$\color{green}9/9$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}132/132$
$\color{green}+100.00\%$
regexp/regexp $\color{green}173/173$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}173/173$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

@Planeshifter Planeshifter changed the title chore: correct interface name and error message typo in regexp/* outliers fix: typo in interface name and error message in two regexp/* packages Jun 2, 2026
@Planeshifter Planeshifter changed the title fix: typo in interface name and error message in two regexp/* packages chore: fix typo in interface name and error message in two regexp/* packages Jun 2, 2026
@Planeshifter Planeshifter marked this pull request as ready for review June 2, 2026 16:01
@Planeshifter Planeshifter requested a review from a team June 2, 2026 16:01
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jun 2, 2026
@Planeshifter Planeshifter requested a review from kgryte June 2, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants