I had the impression that a type assertion to string would result in a previously-unknown type to turn into a string. I appreciate some explanation as to why this is not the case.
$npx ts-node
> undefined as string
[eval].ts:1:1 - error TS2352: Conversion of type 'undefined' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
> undefined as unknown as string
undefined