<commit_before>(function(ionic) {

    // Define local variables
    var defaults = {
        type: 'icon',
        map: {}
    };

    /**
    * isEmpty() checks if the given
    * object is empty.
    *
    * @param {Object} obj
    *
    * @return {Boolean}
    */
    function isEmpty(obj) {
        var obj = Object(obj);

        if (Object.keys(obj).length === 0) {
            return true
        }

        return false;
    }

    angular.module('ionic.contrib.icon', ['ionic'])

    /**
    * @ngdoc object
    * @name $ionicIconConfig
    * @module ionic.contrib.icon
    * @description
    * Sets default behavior of the icon directive.
    *
    * @param {String} type
    * @param {Object} map
    *
    * @usage
    * ```js
    * var app = angular.module('app', ['ionic', 'ionic.contrib.icon'])
    * app.constant('$ionicIconConfig', {
    *   type: 'icon',
    *   map: {
    *       'ion-heart': {
    *           ios: 'ion-ios7-heart',
    *           android: 'ion-android-heart'
    *       }
    *   }
    * });
    * ```
    */
    .constant('$ionicIconConfig', defaults)

    /**
    * icon directive displays an icon
    * depending on the defined options.
    */
    .directive('icon', function($ionicIconConfig) {

        return {
            restrict: 'E',
            scope: {
                ios: '@',
                ipad: '@',
                android: '@',
                windows: '@',
                default: '@'
            },
            link: function($scope, $element, $attrs) {

                var options = $ionicIconConfig;

                function setIcon(icon) {

                    // Check if icon is empty
                    if (isEmpty(icon)) {<commit_msg>Improved directive comments<commit_after>(function(ionic) {

    // Define local variables
    var defaults = {
        type: 'icon',
        map: {}
    };

    /**
    * isEmpty() checks if the given
    * object is empty.
    *
    * @param {Object} obj
    *
    * @return {Boolean}
    */
    function isEmpty(obj) {
        var obj = Object(obj);

        if (Object.keys(obj).length === 0) {
            return true
        }

        return false;
    }

    angular.module('ionic.contrib.icon', ['ionic'])

    /**
    * @ngdoc object
    * @name $ionicIconConfig
    * @module ionic.contrib.icon
    * @description
    * Sets default behavior of the icon directive.
    *
    * @param {String} type
    * @param {Object} map
    *
    * @usage
    * ```js
    * var app = angular.module('app', ['ionic', 'ionic.contrib.icon'])
    * app.constant('$ionicIconConfig', {
    *   type: 'icon',
    *   map: {
    *       'ion-heart': {
    *           ios: 'ion-ios7-heart',
    *           android: 'ion-android-heart'
    *       }
    *   }
    * });
    * ```
    */
    .constant('$ionicIconConfig', defaults)

    /**
    * @ngdoc directive
    * @name icon
    * @module ionic.contrib.icon
    * @restrict E
    *
    * @description
    * The icon directive automatically displays platform-specific icons based on passed options
    * defined by the $ionicIconConfig constant.
    *
    * @param {string=} ios
    * @param {string=} ipad
    * @param {string=} android
    * @param {string=} windows
    * @param {string=} default Required default icon to use.
    */
    .directive('icon', function($ionicIconConfig) {

        return {
            restrict: 'E',
            scope: {
                ios: '@',
                ipad: '@',
                android: '@',
                windows: '@',
                default: '@'
            },
            link: function($scope, $element, $attrs) {

                var options = $ionicIconConfig;

                function setIcon(icon) {

                    // Check if icon is empty
                    if (isEmpty(icon)) {
{'fraction_non_alphanumeric': 0.14218009478672985, 'fraction_numerical': 0.00105318588730911, 'mean_word_length': 1.5158940397350993, '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': '1916427', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1095, 'n_words': 259}