Skip to content

doc: fix URLPattern.exec() example output order - #65803

Open
charpeni wants to merge 1 commit into
nodejs:mainfrom
charpeni:doc/url-fix-urlpattern-exec-example-order
Open

doc: fix URLPattern.exec() example output order#65803
charpeni wants to merge 1 commit into
nodejs:mainfrom
charpeni:doc/url-fix-urlpattern-exec-example-order

Conversation

@charpeni

@charpenicharpeni commented Sep 4, 2026

Copy link
Copy Markdown

The two urlPattern.exec() examples in doc/api/url.md list the result properties in alphabetical order with JSON-style quoting, which is not what console.log() prints. Since #64733 (v24.20.0, v26.7.0) the result properties are created in WebIDL order, so the output starts with inputs, followed by the components from protocol to hash, and each component lists input before groups.

This updates both examples to the actual output of the example code.

Verified by running the example code on v24.19.0 and comparing the printed result with the updated comment block.

Note

Disclosure per the AI use policy: Claude Fable 5.1 (Anthropic), running in Claude Code, was used to audit this page and draft the change. I reviewed the diff and verified the output myself, and I will handle review feedback personally.

Refs: #64733

The two `urlPattern.exec()` examples list the result properties in
alphabetical order with JSON-style quoting, which is not what
`console.log()` prints. Since the result properties are created in
WebIDL order, the output starts with `inputs` followed by the components
from `protocol` to `hash`, and each component lists `input` before
`groups`.
Update both examples to the actual output.
Refs: nodejs#64733
@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to Node.js documentation. url Issues and PRs related to the legacy built-in url module. labels Sep 4, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

@charpenicharpeni changed the title doc: fix URLPattern.exec() example output orderdoc: fix URLPattern.exec() example output orderSep 4, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to Node.js documentation.urlIssues and PRs related to the legacy built-in url module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@charpeni@nodejs-github-bot