Repository navigation
馃摝馃敡锛歛lign validators with runtime checks - #106
Conversation
Stop guards from claiming element, iterator, equality, and refinement types their runtime checks do not establish. Restrict interface guards to finite property shapes and inspect inherited validator maps. Describe map's one-level flattening and add runtime and compile tests. Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is> Assisted-by: Codex:gpt-6-astra Fixes: #99
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 57 minutes. View limit detailsLimit details: You鈥檝e used all 4 included reviews currently available. Your 34 included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. Review configuration: 鈿欙笍 Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 馃搾 Files selected for processing (19)
Comment |
|
@coderabbitai full review This merged while the review was rate-limited, so please review it now. Generated by Claude Code |
|
hasInterface skipped every "constructor" key in a validator map, so a
guard for { constructor: number } accepted {} on the strength of its
inherited Object constructor. Skip only a prototype's own back-reference
to its class, and validate a constructor the interface declares.
CodeRabbit raised this when it reviewed #106 after the merge.
Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is>
Assisted-by: Claude-Code:claude-opus-5
PR-URL: #112
Refs: #106
Several guards and helpers promised types their runtime checks did not prove.
That let strict TypeScript programs compile calls which then failed at runtime,
including unchecked array elements, equality matches, invalid dates, shallow
iterators, open-ended interfaces, and
map()results.This change:
unknown;hasInterfaceto finite property interfaces and checks inheritedvalidator declarations;
map()'s one-level flattening in its return type; andFixes #99.