<commit_before>var module = angular.module('nzSweetAlert', []);

module.value('nzSweetAlertDefaults', {});

module.factory('nzSwal', ['nzSweetAlertDefaults', '$q',
    function(nzSweetAlertDefaults, $q) {
        if (!window.swal) {
            console.log('Sweet Alert is not loaded!');
            return;
        }

        return service;

        function service(p1, p2, p3) {

            var deferred = $q.defer();

            var params = angular.copy(nzSweetAlertDefaults);

            if (typeof p1 !== 'object') {
                params.title = p1 ? p1 : '';
                params.text = p2 ? p2 : '';
                params.type = p3 ? p3 : null;
            } else {
                params = angular.extend(params, p1);
            }

            swal(params, function(isConfirm) {
                if (isConfirm) {
                    deferred.resolve();
                } else {
                    deferred.reject();
                }
            });

            return deferred.promise;
        }
    }<commit_msg>No defaults, already covered in Sweet Alert<commit_after>var module = angular.module('nzSweetAlert', []);

module.factory('nzSwal', ['$q',
    function(nzSweetAlertDefaults, $q) {
        if (!window.swal) {
            console.log('Sweet Alert is not loaded!');
            return;
        }

        return service;

        function service(p1, p2, p3) {

            var deferred = $q.defer();

            var params;

            if (typeof p1 !== 'object') {
                params = {
                    title: p1 ? p1 : '',
                    text: p2 ? p2 : '',
                    type: p3 ? p3 : null,
                };
            } else {
                params = p1;
            }

            swal(params, function(isConfirm) {
                if (isConfirm) {
                    deferred.resolve();
                } else {
                    deferred.reject();
                }
            });

            return deferred.promise;
        }
    }
{'fraction_non_alphanumeric': 0.12362911266201396, 'fraction_numerical': 0.010967098703888335, 'mean_word_length': 1.2225913621262459, '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': '4961711', 'n_tokens_mistral': 587, 'n_tokens_neox': 521, 'n_words': 115}