How can I get the value of a type on runtime?

i tried using @Tesmi 's reflection library but the transformer doesn't seem to work with unions, are there any other methods?
No description
No description
Solution:
solved ```typescript /** @metadata macro */ export function getTypeValue<T>(meta?: Modding.Many<T extends Array<string> ? T : never>) { return meta;...
Jump to solution
6 Replies
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
Tesmi
Tesmi3mo ago
the current transformator doesn't work well with these types, I don't recommend using this library in real work
lisachandra
lisachandraOP3mo ago
i don't wanna use an enum because i'd have to add it manually everytime i have a new state are there alternatives?
Tesmi
Tesmi3mo ago
I didn't quite understand what you wanted to do?
lisachandra
lisachandraOP3mo ago
you can read the images on what the variables are supposed to be
Solution
lisachandra
lisachandra3mo ago
solved
/** @metadata macro */
export function getTypeValue<T>(meta?: Modding.Many<T extends Array<string> ? T : never>) {
return meta;
}
/** @metadata macro */
export function getTypeValue<T>(meta?: Modding.Many<T extends Array<string> ? T : never>) {
return meta;
}
using flamework's modding api

Did you find this page helpful?