mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 23:30:10 +00:00
60aa7032c5
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.
41 lines
977 B
TypeScript
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;
|
|
}
|
|
}
|
|
}
|