Skip to content

feat: stream-level body capture and smart JSON truncation - #7

Merged
codebygarv merged 3 commits into
mainfrom
EL-stream-capture-and-truncation
Jul 31, 2026
Merged

feat: stream-level body capture and smart JSON truncation#7
codebygarv merged 3 commits into
mainfrom
EL-stream-capture-and-truncation

Conversation

@codebygarv

Copy link
Copy Markdown
Owner

Phase 2: Stream-Level Body Capture & Smart Truncation

This Pull Request adds stream-level payload chunking, safety memory limits (maxBodySize), and smart JSON/array payload formatting (maxDepth, maxArrayItems).

Resolves #6

Changes Included

  • src/core/stream.ts: Zero-dependency stream capturer with byte safety limit.
  • src/core/formatter.ts: Recursive payload truncator collapsing deep objects and long arrays.
  • src/middleware.ts: Middleware options update for maxBodySize, maxDepth, and maxArrayItems.

Verification

  • npm run typecheck (0 errors)
  • npm test (38/38 tests passing)
  • npm run build (Multi-entry CJS, ESM, and .d.ts bundles built)

@codebygarv
codebygarv merged commit d2698d2 into main Jul 31, 2026
3 checks passed
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.

feat: stream-level body capture and smart JSON truncation

1 participant