<commit_before>import methodMap from './methodMap';
import semver from 'semver';

export default (methodName, version) => {
    if (!methodMap[methodName]) {
        throw new Error('lodash method "' + methodName + '" does not exist. If you think it is an error, report it at https://github.com/gajus/babel-plugin-lodash-modularize/issues/1.');
    }

    if (semver.gte(version, '4.0.0')) {
        return 'lodash/' + methodName;
    }

    if (semver.gte(version, '3.0.0')) {
        return 'lodash/' + methodMap[methodName] + '/' + methodName;
    }

    throw new Error('Unknown lodash version.');
};<commit_msg>methodMap condition must be placed after the version is matched.<commit_after>import methodMap from './methodMap';
import semver from 'semver';

export default (methodName, version) => {
    if (semver.gte(version, '4.0.0')) {
        return 'lodash/' + methodName;
    }

    if (semver.gte(version, '3.0.0')) {
        if (!methodMap[methodName]) {
            throw new Error('lodash method "' + methodName + '" does not exist. If you think it is an error, report it at https://github.com/gajus/babel-plugin-lodash-modularize/issues/1.');
        }

        return 'lodash/' + methodMap[methodName] + '/' + methodName;
    }

    throw new Error('Unknown lodash version.');
};
{'fraction_non_alphanumeric': 0.15212355212355214, 'fraction_numerical': 0.010810810810810811, 'mean_word_length': 3.06269592476489, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '4513357', 'n_tokens_mistral': 421, 'n_tokens_neox': 408, 'n_words': 111}