Skip to content

docs: fix normalizeURL example output (query space is + not %20)#357

Open
patrickwehbe wants to merge 1 commit into
unjs:mainfrom
patrickwehbe:fix-normalizeurl-query-space-example
Open

docs: fix normalizeURL example output (query space is + not %20)#357
patrickwehbe wants to merge 1 commit into
unjs:mainfrom
patrickwehbe:fix-normalizeurl-query-space-example

Conversation

@patrickwehbe

@patrickwehbe patrickwehbe commented Jun 26, 2026

Copy link
Copy Markdown

The normalizeURL JSDoc example shows the query-string space encoded as %20, but the function encodes query-string spaces as + (through encodeQueryValue in src/encoding.ts). The hash part is correctly %20.

Running the example:

normalizeURL("test?query=123 123#hash, test")
// actual:   "test?query=123+123#hash,%20test"
// example:  "test?query=123%20123#hash,%20test"

Updated the example to the real output. The README block is generated from this JSDoc, so I reran pnpm automd to keep it in sync.

Summary by CodeRabbit

  • Documentation
    • Updated the normalizeURL example to show the current expected encoding format for spaces in query/hash output.
    • Aligned the README and inline usage example so they now reflect + encoding instead of %20 for that sample case.

The JSDoc example shows the query-string space encoded as %20, but
normalizeURL encodes query-string spaces as + (encodeQueryValue).
Update the example, and the auto-generated README, to the real output.
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 211d173c-f5e1-44e6-bb9d-d08c9f8148f1

📥 Commits

Reviewing files that changed from the base of the PR and between f06c800 and 06dcd69.

📒 Files selected for processing (2)
  • README.md
  • src/utils.ts

📝 Walkthrough

Walkthrough

Updated the normalizeURL example output in the source JSDoc and README so the documented query-space encoding uses + instead of %20.

Changes

normalizeURL documentation update

Layer / File(s) Summary
Example output encoding
src/utils.ts, README.md
normalizeURL example output in the source comment and README now shows + encoding for the space in the query example.

Sequence Diagram(s)

None

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A bunny hopped through docs today, 🐇
Swapping %20 along the way.
With + in tow, the examples gleam,
A tiny fix in a URL dream.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: correcting the normalizeURL example output to show query spaces as + instead of %20.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant