error TS1355: A ‘const’ assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals.
Broken Code ❌
Fixed Code ✔️
You cannot apply a const assertion to the result of a ternary operator. It is necessary to restrict the usage of const assertions to the individual literal expressions: