This PR adds a any type detection path for StaticDecode.
It is noted that even though the StaticDecode type is constrained to generic parameters of type TSchema; passing any for a parameter is still permissible as any does loosely satisfy this constraint. However in the context of StaticDecode, passing any does result in TS2589 instantiation issues due to any yielding union results when used as a left-side operand in conditional expressions (classic example below)
type T = any extends string ? 1 : 2 // T = 1 | 2
This PR attempts to catch any for StaticDecode specifically, principally because StaticDecode makes heavy use of conditional mapping, and where union results for any cause ambiguous resolution during type decoding.
This PR adds a
any
type detection path forStaticDecode
.It is noted that even though the
StaticDecode
type is constrained to generic parameters of typeTSchema
; passingany
for a parameter is still permissible asany
does loosely satisfy this constraint. However in the context of StaticDecode, passingany
does result in TS2589 instantiation issues due to any yielding union results when used as a left-side operand in conditional expressions (classic example below)This PR attempts to catch
any
for StaticDecode specifically, principally because StaticDecode makes heavy use of conditional mapping, and where union results forany
cause ambiguous resolution during type decoding.