Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function releaseTypeFromRepoLanguage(language: string | null): ReleaseType {
if (language == null) {
throw Error('repository has no detected language');
}
switch (language.toLowerCase()) {
case 'ruby':
return ReleaseType.Ruby;
case 'java':
return ReleaseType.JavaYoshi;
case 'typescript':
case 'javascript':
return ReleaseType.Node;
case 'php':
return ReleaseType.PHPYoshi;
default:
throw Error(`unknown release type: ${language}`);
}
}