oneuptime/Common/Utils/TechStack.ts
Simon Larsen 60aa7032c5
refactor: Update TechStack enum and related imports
This commit updates the TechStack enum in the TechStack.ts file to include a comprehensive list of technology stacks. It also updates the import paths in various files to reflect the changes from using ServiceLanguage to TechStack. This refactoring improves the clarity and consistency of the codebase.
2024-07-16 14:07:47 -06:00

41 lines
977 B
TypeScript

import TechStack from "../Types/ServiceCatalog/TechStack";
export default class ServiceLanguageUtil {
public static getLanguageByFileExtension(data: {
fileExtension: string;
}): TechStack {
const { fileExtension } = data;
switch (fileExtension) {
case "js":
return TechStack.JavaScript;
case "ts":
return TechStack.TypeScript;
case "py":
return TechStack.Python;
case "rb":
return TechStack.Ruby;
case "java":
return TechStack.Java;
case "php":
return TechStack.PHP;
case "cs":
return TechStack.CSharp;
case "cpp":
return TechStack.CPlusPlus;
case "rs":
return TechStack.Rust;
case "swift":
return TechStack.Swift;
case "kt":
return TechStack.Kotlin;
case "go":
return TechStack.Go;
case "sh":
return TechStack.Shell;
default:
return TechStack.Other;
}
}
}