Repository navigation
docs: describe checker caching and type guard interop accurately - #456
Conversation
Replace the "Zero runtime overhead" claim, which described checker construction caching as if validation itself were free, and drop the Zod comparison. The README now states what the WeakMap cache covers and highlights interoperability with existing type guards. Closes #451 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019BJENnU8SXcDH2Tcx5EWE4
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #456 +/- ##
=======================================
Coverage 98.46% 98.46%
=======================================
Files 52 52
Lines 3057 3057
Branches 327 327
=======================================
Hits 3010 3010
Misses 46 46
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gjbkz
left a comment
There was a problem hiding this comment.
Reviewed commit 195d6de2cda7bb57fa334634a03ec4d7e92d9fbe.
No actionable issues found in this documentation change.
The updated README correctly distinguishes cached checker construction from per-call input validation and describes interoperability with standard TypeGuards without implying that Zod requires separately maintained interfaces. I checked the wording against the checker factory/cache implementation and the existing usage examples.
Validation: the GitHub Actions test workflow for this commit passed. This PR only changes prose; no new local runtime tests were run for this review.
Requested by Kei · project thread
Before: the README advertised "Zero runtime overhead — Results are cached via WeakMap", although only checker construction is cached and every call still validates the input, and its intro implied Zod users must keep schemas and interfaces in sync by hand.
After: the intro drops the Zod comparison and says checkers are ordinary type guards that compose with existing predicates. The features list gains an "Interoperates with existing type guards" item pointing at
typeChecker,narrow,unionandfromDiagnosis(the Usage section already has examples of each), and "Cached checker construction" says the cache is keyed by the definition object and that validation results are not cached.Closes #451
🤖 Generated with Claude Code
https://claude.ai/code/session_019BJENnU8SXcDH2Tcx5EWE4
Generated by Claude Code