typescript convert string to literal type 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';