You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: resolve mapped type properties correctly
Mapped types (like Record<K, V> and inline mapped types) have synthetic
properties without explicit declarations. Updated safeGetPropertyType()
to use checker.getPropertyOfType() + getTypeOfSymbol() to resolve these
property types correctly, preventing them from falling back to 'any'
(which generates permissive 'true' schemas).
Added fixture test for inline mapped types to prevent regression.
* switch to filtering out types from being named based on whether they're parametrized generics rather than whether they're library functions
* fmt
* refactor: cleanup and add edge case tests for Record types
Cleanup:
- Reverted aliasSymbol extraction to keep diff minimal
- Reverted targetSymbol scope to original tighter scope
- Both changes maintain exact same behavior, just cleaner
New edge case tests:
- Record<string, T> with additionalProperties
- Generic types with default parameters
- Conditional types resolving to Records
* fix: handle generic type instantiation and optional properties in safeGetPropertyType
- Compare parent vs declaration types to detect generic instantiation (e.g., Box<number>)
- Strip | undefined from optional properties using type flags instead of string matching
- Handle Partial<T> and other mapped types correctly
- Fix recursion tests by preferring declaration type for optional properties
* correct test expectation
* fmt
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments