<commit_before>export interface FunctionsVersionInfo {
    runtimeStable: string[];
    runtimeDefault: string;
}

export class FunctionsVersionInfoHelper {

    public static needToUpdateRuntime(version: FunctionsVersionInfo, extensionVersion: string) {
        const match = version.runtimeStable.find(v => {
            return extensionVersion.toLowerCase() === v;
        });
        return !match;
    }

    public static getFuntionGeneration(runtimeVersion: string) {
        return (runtimeVersion.startsWith('~2')
            || runtimeVersion.startsWith('2')
            || runtimeVersion.startsWith('beta')) ? 'V2' : 'V1';
    }<commit_msg>If functions_extension_version is not defined the portal can't load functions. Fixes #2148<commit_after>export interface FunctionsVersionInfo {
    runtimeStable: string[];
    runtimeDefault: string;
}

export class FunctionsVersionInfoHelper {

    public static needToUpdateRuntime(version: FunctionsVersionInfo, extensionVersion: string) {
        const match = version.runtimeStable.find(v => {
            return extensionVersion.toLowerCase() === v;
        });
        return !match;
    }

    public static getFuntionGeneration(runtimeVersion: string) {
        if (!runtimeVersion) {
            return 'V1';
        }

        return (runtimeVersion.startsWith('~2')
            || runtimeVersion.startsWith('2')
            || runtimeVersion.startsWith('beta')) ? 'V2' : 'V1';
    }
{'fraction_non_alphanumeric': 0.10719225449515905, 'fraction_numerical': 0.008990318118948824, 'mean_word_length': 3.1580459770114944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7394191', 'n_tokens_mistral': 381, 'n_tokens_neox': 377, 'n_words': 83}