This is an unsafe helper to assert that the given str expression
is actually a string literal union of the given enum.
const expr = e.str('red') // edgeql str literal whose TS value is `string`
castToEnum(expr, ['red', 'blue']) // expression TS value is now `'red' | 'blue'`
This is an unsafe helper to assert that the given str expression is actually a string literal union of the given enum.