<commit_before>﻿(function () {
    'use strict';

    var identityService = function identityService() {
        var currentUser = {};
        var deferred = $q.defer();

        return {
            getUser: function () {
                if (this.isAuthenticated()) {
                    return $q.resolve(currentUser);
                }

                return deferred.promise;
            },
            isAuthenticated: function () {
                return Object.getOwnPropertyNames(currentUser).length !== 0;
            },
            setUser: function (user) {
                currentUser = user;
                deferred.resolve(user);
            },
            removeUser: function () {
                currentUser = {};
            }
        };
    };

    angular
        .module('showcaseSystem.services')
        .factory('identity', [identityService]);
}());<commit_msg>Identity now has $q added<commit_after>﻿(function () {
    'use strict';

    var identityService = function identityService($q) {
        var currentUser = {};
        var deferred = $q.defer();

        return {
            getUser: function () {
                if (this.isAuthenticated()) {
                    return $q.resolve(currentUser);
                }

                return deferred.promise;
            },
            isAuthenticated: function () {
                return Object.getOwnPropertyNames(currentUser).length !== 0;
            },
            setUser: function (user) {
                currentUser = user;
                deferred.resolve(user);
            },
            removeUser: function () {
                currentUser = {};
            }
        };
    };

    angular
        .module('showcaseSystem.services')
        .factory('identity', ['$q', identityService]);
}());
{'fraction_non_alphanumeric': 0.12040133779264214, 'fraction_numerical': 0.0011148272017837235, 'mean_word_length': 1.3933333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5831638', 'n_tokens_mistral': 451, 'n_tokens_neox': 422, 'n_words': 83}