2 ms·
And herein lies one of the worst features of Typescript. const myCompanyId = something_complicated as CompanyId; where something_complicated actually is a
by yencabulator 3y ago
And herein lies one of the worst features of Typescript.
const myCompanyId = something_complicated as CompanyId;
where something_complicated actually is a UserId, not a bare string.
It is way too easy to accidentally destroy type safety with `as`, there are absolutely 0 safeguards.
I fear every single instance of `as` in any Typescript source I see.