3 ms·
What's nice here is that `makeHash: Hash = (x: string) => x as Hash` checks that `x` actually overlaps with the branded type (string, in this case). At first i
by hombre_fatal 2y ago
What's nice here is that `makeHash: Hash = (x: string) => x as Hash` checks that `x` actually overlaps with the branded type (string, in this case).
At first it looks like you could just lie and say `x as User` or something but it's not the case.