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
refactor(core): constrain resolveOption to non-function types
Add NonFunction type constraint to resolveOption's generic parameter T to prevent
ambiguity when T itself is a function type. This ensures the value-or-function
pattern remains unambiguous by restricting T to primitives, objects, and other
non-function types.
- Define NonFunction union type covering all non-function types
- Apply constraint to resolveOption<T extends NonFunction, ...>
- Update functionalUpdate to use same constraint
- Remove isFunctionVariant helper (inlined typeof check)
- Simplify resolveOption implementation
This prevents TypeScript errors where function types could be ambiguous in the
T | (() => T) pattern, making the API more type-safe.
0 commit comments