{"version":3,"file":"enumeration-CGKJz5R9.js","sources":["../../js/types/global/enumeration.ts"],"sourcesContent":["import Option from \"./option\";\n\nexport default function Enumeration<T>() {\n abstract class Enumeration {\n protected constructor(public readonly name: string) {};\n\n /**\n * Create an Option<T> enum from string\n */\n public static fromString(string: string): Option<T> {\n return Option.someNotNull((this as any)[string]);\n }\n\n /**\n * Loop over all instances of the enumeration\n */\n public static get enumerators(): T[] {\n return Object.keys(this).map(key => (this as any)[key]);\n } \n\n /**\n * Loop over all instances of the enumeration\n */\n public static get values(): T[] {\n return this.enumerators;\n }\n }\n\n return Enumeration;\n}"],"names":["Enumeration","name","string","Option","key"],"mappings":"ooBAEA,SAAwBA,GAAiB,CACrC,MAAeA,CAAY,CACb,YAA4BC,EAAc,CAAd,KAAA,KAAAA,CAAe,CAKrD,OAAc,WAAWC,EAA2B,CAChD,OAAOC,EAAO,YAAa,KAAaD,CAAM,CAAC,CACnD,CAKA,WAAkB,aAAmB,CAC1B,OAAA,OAAO,KAAK,IAAI,EAAE,IAAYE,GAAA,KAAaA,CAAG,CAAC,CAC1D,CAKA,WAAkB,QAAc,CAC5B,OAAO,KAAK,WAChB,CACJ,CAEOJ,OAAAA,CACX"}