Massive refactor (#165)

This commit is contained in:
Oliver King
2022-02-02 09:07:53 -05:00
committed by GitHub
parent 5cbd4acaca
commit ca8d2604ac
139 changed files with 19176 additions and 17005 deletions
+17
View File
@@ -0,0 +1,17 @@
export enum Action {
DEPLOY = "deploy",
PROMOTE = "promote",
REJECT = "reject",
}
/**
* Converts a string to the Action enum
* @param str The action type (case insensitive)
* @returns The Action enum or undefined if it can't be parsed
*/
export const parseAction = (str: string): Action | undefined =>
Action[
Object.keys(Action).filter(
(k) => Action[k].toString().toLowerCase() === str.toLowerCase()
)[0] as keyof typeof Action
];