<commit_before>angular.module('ngPrestashop', [])
    .provider('prestashop', function prestashopProvider() {
        var params = null;
        var baseUrl = null;

        function addParams(source, _params) {
            var __params = {};
            __params = angular.copy(source, __params);
            for (var param in _params) {
                __params[param] = _params[param];
            }
            return __params;
        }

        this.setParams = function (_params) {
            params = _params;
        };
        this.setBaseUrl = function (_baseUrl) {
            baseUrl = _baseUrl;
        };
        this.$get = ["$http", function ($http) {
            return {
                get: function (_params) {
                    return $http.get(baseUrl, {'params': addParams(params, _params)})
                },
                post: function (_params, body) {
                    return $http.post(baseUrl, body, {'params': addParams(params, _params)})
                }
            }
        }];
    });

angular.module('angular-prestashop', ['ngPrestashop', 'ngRoute', 'angular-md5'])
    .config(function ($interpolateProvider, $routeProvider, prestashopProvider) {

        $interpolateProvider.startSymbol('//');
        $interpolateProvider.endSymbol('//');

        $routeProvider
            .when("/", {redirectTo: "/settings"})
            .when("/settings", {controller: 'SettingsCtrl', templateUrl: "settings.html"})
            .when("/404", {templateUrl: "404.html"})
            .otherwise({redirectTo: "/"});

        prestashopProvider.setParams({
            'ajax': 1,
            'controller': 'AdminAngular',
            'token': ctrl_token
        });
        prestashopProvider.setBaseUrl('/admin-dev/index.php');

    })
    .provider('configuration', function ConfigurationProvider() {
        this.$get = ["$http", "prestashop", function ($http, prestashop) {
            return {
                set: function (key, value) {
                    return prestashop.post({'action': 'updateConfiguration', 'key': key}, value)
                },
                get: function (key) {
                    return prestashop.get({'action': 'getConfiguration', 'key': key})
                }
            };
        }];
    });<commit_msg>use $.extend instead of custom helper<commit_after>angular.module('ngPrestashop', [])
    .provider('prestashop', function prestashopProvider() {
        var params = {};
        this.setParams = function (_params) {
            params = _params;
        };
        this.$get = ["$http", function ($http) {
            return {
                get: function (_params) {
                    return $http.get(location.pathname, {'params': $.extend(true, {}, params, _params)})
                },
                post: function (_params, body) {
                    return $http.post(location.pathname, body, {'params': $.extend(true, {}, params, _params)})
                }
            }
        }];
    });

angular.module('angular-prestashop', ['ngPrestashop', 'ngRoute', 'angular-md5'])
    .config(function ($interpolateProvider, $routeProvider, prestashopProvider) {

        $interpolateProvider.startSymbol('//');
        $interpolateProvider.endSymbol('//');

        $routeProvider
            .when("/", {redirectTo: "/settings"})
            .when("/settings", {controller: 'SettingsCtrl', templateUrl: "settings.html"})
            .when("/404", {templateUrl: "404.html"})
            .otherwise({redirectTo: "/"});

        prestashopProvider.setParams({
            'ajax': 1,
            'controller': 'AdminAngular',
            'token': ctrl_token
        });
    })
    .provider('configuration', function ConfigurationProvider() {
        this.$get = ["$http", "prestashop", function ($http, prestashop) {
            return {
                set: function (key, value) {
                    return prestashop.post({'action': 'updateConfiguration', 'key': key}, value)
                },
                get: function (key) {
                    return prestashop.get({'action': 'getConfiguration', 'key': key})
                }
            };
        }];
    });
{'fraction_non_alphanumeric': 0.15150060024009604, 'fraction_numerical': 0.0038415366146458585, 'mean_word_length': 1.8456284153005464, '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': '2185289', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1086, 'n_words': 218}