Skip to content

docs: align README examples with v3 match results - #115

Merged
blakeembrey merged 1 commit into
jshttp:masterfrom
kilisamemarisaaa:codex/fix-v3-readme-examples
Oct 30, 2026
Merged

blakeembrey merged 1 commit into
jshttp:masterfrom
kilisamemarisaaa:codex/fix-v3-readme-examples

Conversation

@kilisamemarisaaa

Copy link
Copy Markdown
Contributor

After #109, TypeIs returns the original configured string. The README body-parser example still switches on normalized MIME types, so requests for all three configured types fall through to HTTP 415.

Update the switch cases and the request() return-value example to preserve the configured shorthands, and explain that return contract. Also use explicit named ESM imports in the examples to match the v3 exports.

Validation on upstream f61fd0318c775d8e4a9590143eb92487c23afe58, Windows, Node 24.12.0:

  • Executed the README middleware against real HTTP requests using Express. JSON, urlencoded, and multipart requests all returned 415 before the edit; afterward each reaches its respective existing parsing placeholder. Unsupported text/plain still returns 415, and a bodyless GET still calls the next handler. The harness resolves imports locally and catches the example's intentional implement ... parsing errors to identify the selected branch; it does not implement body parsing.
  • Checked the four documented request() results: one mismatch before, all correct afterward. Checked the named imports and all five match() examples against the built module.
  • npm test: passes, including build, Prettier, typechecking, and all 311 tests. git diff --check passes.

Documentation only. Implementation and verification assisted by Codex.

@blakeembrey
blakeembrey merged commit 1e658be into jshttp:master Oct 30, 2026
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.

2 participants