Require a value to be one of a fixed set of names.
TypeScript checks string-union options at compile time only, so a value that
arrives from JSON, a config file, or a JavaScript caller reaches the engine
unchecked and is then read against a table that has no entry for it —
producing a silent undefined, a NaN velocity, or a crash far from the call.
If the value is not one of allowed. The message names the value by
its type unless it is a string, and echoes at most the head of that string,
so building it cannot itself fail on a circular object and cannot grow with
the size of what was pasted into the field.
Require a value to be one of a fixed set of names.
TypeScript checks string-union options at compile time only, so a value that arrives from JSON, a config file, or a JavaScript caller reaches the engine unchecked and is then read against a table that has no entry for it — producing a silent
undefined, a NaN velocity, or a crash far from the call.