<commit_before>(function (root, factory) {
    // Using the Universal Module Definition pattern from
    // https://github.com/umdjs/umd/blob/master/returnExports.js
    if (typeof define === 'function' && define.amd) {
        define(['iscroll'], factory);
    } else if (typeof exports === 'object') {
        module.exports = factory(require('iscroll'));
    } else {
        // Browser globals (root is window)
        root.angularIscroll = factory(root.IScroll);
    }
}(this, function (IScroll) {
    'use strict';

    var signals = {
            disabled: 'iscroll:disabled',
            enabled: 'iscroll:enabled',
            refresh: 'iscroll:refresh'
        },
        classes = {
            on: 'iscroll-on',
            off: 'iscroll-off'
        },
        iScrollEvents = [
            'beforeScrollStart',
            'scrollCancel',
            'scrollStart',
            'scroll',
            'scrollEnd',
            'flick',
            'zoomStart',
            'zoomEnd'
        ],
        iScrollEventHandlerMap = {};

    /**
     * Add handler name to event name mapping.
     *
     * Please note that the 'scroll' event is only available when using
     * iscroll-probe.js (for example, through angular-iscroll-probe).
     *
     * For example, the handler for the 'scrollEnd' event can be configured
     * by supplying the onScrollEnd option.
     **/
    angular.forEach(iScrollEvents, function _addPair(event) {
        this['on' + _capitalizeFirst(event)] = event;
    }, iScrollEventHandlerMap);

    function _capitalizeFirst(str) {
        return str.substring(0,1).toLocaleUpperCase() + str.substring(1);
    }

    function iScrollServiceProvider() {
        var defaultOptions = {
                iScroll: {
                    /**
                     * The different options for iScroll are explained in
                     * detail at http://iscrolljs.com/#configuring
                     **/
                    momentum: true,
                    mouseWheel: true
                },
                directive: {
                    /**
                     * Delay, in ms, before we asynchronously perform an
                     * iScroll.refresh().  If false, then no async refresh is
                     * performed.
                     **/
                    asyncRefreshDelay: 0,
                    /**
                     * Delay, in ms, between each iScroll.refresh().  If false,
                     * then no periodic refresh is performed.
                     **/
                    refreshInterval: false,
                    /**
                     * If `false`, skip `$digest()` cycle on iScroll.refresh().
                     */
                    invokeApply: false
                    /**
                     * Event handler options are added below.
                     **/
                }
            };

        angular.forEach(iScrollEventHandlerMap, function _default(event, handler) {
            this[handler] = undefined;
        }, defaultOptions.directive);

        function _configureDefaults(options) {
            angular.extend(defaultOptions, options);
        }

        this.configureDefaults = _configureDefaults;
        function _getDefaults() {
            return defaultOptions;<commit_msg>Fixes #26: iScrollServiceProvider.configureDefaults() does not perform a deep merge of options with defaultOptions.<commit_after>(function (root, factory) {
    // Using the Universal Module Definition pattern from
    // https://github.com/umdjs/umd/blob/master/returnExports.js
    if (typeof define === 'function' && define.amd) {
        define(['iscroll'], factory);
    } else if (typeof exports === 'object') {
        module.exports = factory(require('iscroll'));
    } else {
        // Browser globals (root is window)
        root.angularIscroll = factory(root.IScroll);
    }
}(this, function (IScroll) {
    'use strict';

    var signals = {
            disabled: 'iscroll:disabled',
            enabled: 'iscroll:enabled',
            refresh: 'iscroll:refresh'
        },
        classes = {
            on: 'iscroll-on',
            off: 'iscroll-off'
        },
        iScrollEvents = [
            'beforeScrollStart',
            'scrollCancel',
            'scrollStart',
            'scroll',
            'scrollEnd',
            'flick',
            'zoomStart',
            'zoomEnd'
        ],
        iScrollEventHandlerMap = {};

    /**
     * Add handler name to event name mapping.
     *
     * Please note that the 'scroll' event is only available when using
     * iscroll-probe.js (for example, through angular-iscroll-probe).
     *
     * For example, the handler for the 'scrollEnd' event can be configured
     * by supplying the onScrollEnd option.
     **/
    angular.forEach(iScrollEvents, function _addPair(event) {
        this['on' + _capitalizeFirst(event)] = event;
    }, iScrollEventHandlerMap);

    function _capitalizeFirst(str) {
        return str.substring(0,1).toLocaleUpperCase() + str.substring(1);
    }

    function iScrollServiceProvider() {
        var defaultOptions = {
                iScroll: {
                    /**
                     * The different options for iScroll are explained in
                     * detail at http://iscrolljs.com/#configuring
                     **/
                    momentum: true,
                    mouseWheel: true
                },
                directive: {
                    /**
                     * Delay, in ms, before we asynchronously perform an
                     * iScroll.refresh().  If false, then no async refresh is
                     * performed.
                     **/
                    asyncRefreshDelay: 0,
                    /**
                     * Delay, in ms, between each iScroll.refresh().  If false,
                     * then no periodic refresh is performed.
                     **/
                    refreshInterval: false,
                    /**
                     * If `false`, skip `$digest()` cycle on iScroll.refresh().
                     */
                    invokeApply: false
                    /**
                     * Event handler options are added below.
                     **/
                }
            };

        angular.forEach(iScrollEventHandlerMap, function _default(event, handler) {
            this[handler] = undefined;
        }, defaultOptions.directive);

        function _configureDefaults(options) {
            /**
             * Since angular.extend is not performing a "deep" merge, we'll
             * do it in two steps.
             **/
            if (angular.isDefined(options.directive)) {
                angular.extend(defaultOptions.directive, options.directive);
            }
            if (angular.isDefined(options.iScroll)) {
                angular.extend(defaultOptions.iScroll, options.iScroll);
            }
        }

        this.configureDefaults = _configureDefaults;
        function _getDefaults() {
            return defaultOptions;
{'fraction_non_alphanumeric': 0.10072248193795155, 'fraction_numerical': 0.0014166312508853945, 'mean_word_length': 1.4454450987183929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3485925', 'n_tokens_mistral': 1760, 'n_tokens_neox': 1675, 'n_words': 431}