As a newcomer to TypeScript coming from the JavaScript world, please bear with me if my questions seem naive.
What am I trying to accomplish?
enum Add {
PREFIX = 'ADD',
ROUTE_PREFIX = 'add'
}
export CrudAdd {
`${Add.PREFIX}_CUSTOMER` = `${Add.ROUTE_PREFIX}-customer`,
// ....
}
I want to avoid typing *_CUSTOMER
repeatedly.
This is achievable in plain JS as shown below:
const obj = {
`${Add.PREFIX}_CUSTOMER`: `${Add.ROUTE_PREFIX}-customer`
}
I have come across information stating that after compilation, an enum is just a JavaScript object.
Is there a way to achieve this behavior?
Once again, I apologize for this question.