mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-23 13:09:27 +08:00
Massive refactor (#165)
This commit is contained in:
@@ -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
|
||||
];
|
||||
Reference in New Issue
Block a user