typescript cast a string to an option code example
Example: typescript string to string literal
// stringLiteral is type of 'someString', not string
const stringLiteral = 'someString' as 'someString';
// stringLiteral is type of 'someString', not string
const stringLiteral = 'someString' as 'someString';