Skip to content

fix(man-page): keep the last environment variable when its section ends the input - #1202

Merged
ovflowd merged 1 commit into
nodejs:mainfrom
kgeminicdev:fix/man-page-last-env-var
Oct 31, 2026
Merged

ovflowd merged 1 commit into
nodejs:mainfrom
kgeminicdev:fix/man-page-last-env-var

Conversation

@kgeminicdev

Copy link
Copy Markdown
Contributor

Description

When nothing follows the environment variables section, findIndex returns -1 and slice(environmentStart + 1, -1) drops the last variable. The section now runs to the end of the input in that case.

Validation

Added man-page/__tests__/generate.test.mjs with the input from #1198 (expects all three variables), plus a case where another ## follows the section to check it still stops there. I couldn't run the suite locally; relying on CI here.

Related Issues

Fixes #1198

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format:check & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

…ds the input

When nothing follows the environment variables section, findIndex returns
-1 and slice(start, -1) drops the last entry. Read to the end of the input
in that case.

Fixes nodejs#1198

Signed-off-by: kgeminicdev <kurtgeminicb@gmail.com>
@kgeminicdev
kgeminicdev requested a review from a team as a code owner October 30, 2026 02:45
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api-docs-tooling Ready Ready Preview Oct 30, 2026 2:46am UTC

Request Review

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.74%. Comparing base (060be4c) to head (7e89e5a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1202      +/-   ##
==========================================
+ Coverage   93.56%   93.74%   +0.18%     
==========================================
  Files         287      288       +1     
  Lines       28577    28637      +60     
  Branches     2882     2894      +12     
==========================================
+ Hits        26737    26846     +109     
+ Misses       1818     1769      -49     
  Partials       22       22              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

api-links Generator

Performance estimate (single CI run)

  • Generation time: 19.6% faster (1.02 s → 820.00 ms)
  • Peak memory: 6.4% higher (276.75 MB → 294.35 MB)

json Generator

Performance estimate (single CI run)

  • Generation time: 0.3% slower (10.01 s → 10.04 s)
  • Peak memory: 2.4% lower (1.18 GB → 1.15 GB)

legacy-html Generator

Performance estimate (single CI run)

  • Generation time: 24.1% faster (16.78 s → 12.74 s)
  • Peak memory: 5.0% higher (1.72 GB → 1.80 GB)

legacy-json Generator

Performance estimate (single CI run)

  • Generation time: 1.6% faster (9.27 s → 9.12 s)
  • Peak memory: 3.3% lower (1.19 GB → 1.15 GB)

llms-txt Generator

Performance estimate (single CI run)

  • Generation time: 63.2% slower (4.95 s → 8.08 s)
  • Peak memory: 7.4% lower (1.27 GB → 1.18 GB)

orama-db Generator

Performance estimate (single CI run)

  • Generation time: 5.6% slower (8.09 s → 8.54 s)
  • Peak memory: 3.5% lower (1.28 GB → 1.23 GB)

web Generator

Performance estimate (single CI run)

  • Generation time: 49.2% slower (16.23 s → 24.22 s)
  • Peak memory: 1.8% higher (2.03 GB → 2.06 GB)

@ovflowd
ovflowd merged commit ccd02e8 into nodejs:main Oct 31, 2026
22 of 23 checks passed
@ovflowd

ovflowd commented Oct 31, 2026

Copy link
Copy Markdown
Member

Thank you @kgeminicdev for your first time contribution!!

@github-actions github-actions Bot mentioned this pull request Oct 31, 2026

This branch was successfully deployed

1 active deployment
Preview – api-docs-tooling — 7e89e5a7 Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

man-page: drops the last environment variable when the section ends the page

3 participants