Skip to content

remove router.compile dead code, fix http docs, add uint8array doc, f…#101

Merged
cs01 merged 1 commit intomainfrom
http-docs-cleanup
Mar 6, 2026
Merged

remove router.compile dead code, fix http docs, add uint8array doc, f…#101
cs01 merged 1 commit intomainfrom
http-docs-cleanup

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 6, 2026

Summary

  • Remove Router.compile() dead codehandle() never used this.compiledRegex; the method, its helper countGroups(), and the associated fields (compiled, compiledRegex, groupOffset, groupCount) were never read. Removed entirely.
  • Fix ChadScript.serveEmbedded d.ts signature — was typed as (req: HttpRequest) but actually takes (path: string). Also added missing getEmbeddedFileAsUint8Array to the namespace declaration.
  • Add c.bytes() to Context response table in http-server.md — it existed in code and d.ts but wasn't documented.
  • Add bodyLen to HttpRequest/HttpResponse doc tables — required for binary-safe request reading and response construction; was missing from both tables.
  • Document serveFile() and bytesResponse() — exported from chadscript/http but absent from docs and the stdlib index module table.
  • Add Uint8Array stdlib page — used across fs, HTTP, embed, and crypto APIs but had no reference page.

Test plan

  • npm test passes (all existing tests green)
  • Router still works correctly — handle() logic unchanged, only dead fields/methods removed
  • Docs build: cd docs && npm run dev renders Uint8Array page and updated http-server page correctly

@cs01 cs01 merged commit 786f024 into main Mar 6, 2026
12 checks passed
@cs01 cs01 deleted the http-docs-cleanup branch March 12, 2026 05:35
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