| ▲ | kayson 11 hours ago | |
So satisfies prevent you from mutating then? Otherwise you could just change name afterwards... | ||
| ▲ | int_19h 9 hours ago | parent [-] | |
It prevents you from mutating via the reference that you obtain from `satisfies` without casting its type, yes (or rather more precisely, you can mutate it, but only to the one allowed value). However, the object can still be mutated via other references to it. TypeScript is full of holes like this in the type system - the problem is that they are trying to bolt types and immutability onto a hot mess that is JS data model while preserving backwards compatibility. | ||