<commit_before>/* datatable: advanced search */

(function(factory) {
	'use strict';
	require(['Abilian', 'jquery', 'jquery.dataTables'], factory );
}
(function(Abilian, $) {
    'use strict';

    function defaultDatatableConfig() {
        if (!Abilian.DEBUG) {
            /* deactivate datatable issuing 'alert' on any error in production.
             * It confuses users. */
            $.fn.dataTable.ext.sErrMode = '';
        }
    }
    defaultDatatableConfig();

    /* create new filter instance */
    function instantiateFilter(filterType, args) {
        var FilterClass = AdvancedSearchFilters.oFilters[filterType],
            instance = Object.create(FilterClass.prototype);
        FilterClass.apply(instance, args);
        return instance;
    }

    /*
     * Helper to check equality for filter values
     */
    function hasValueSet(filter) {
        var unset = filter.unsetValue,
            val = filter.save();

        if (filter.hasValueSet !== undefined) {
            return filter.hasValueSet();
        }

        if (!Array.isArray(val)) { return true; }

        // ensure unset is an array
        if (!Array.isArray(unset)) { unset = [ unset ]; }
<commit_msg>fix: never require 'Abilian' in libs<commit_after>/* datatable: advanced search */

(function(factory) {
	'use strict';
	require(['AbilianNS', 'jquery', 'jquery.dataTables'], factory );
}
(function(Abilian, $) {
    'use strict';

    function defaultDatatableConfig() {
        if (!Abilian.DEBUG) {
            /* deactivate datatable issuing 'alert' on any error in production.
             * It confuses users. */
            $.fn.dataTable.ext.sErrMode = '';
        }
    }
    Abilian.fn.onAppInit(defaultDatatableConfig);

    /* create new filter instance */
    function instantiateFilter(filterType, args) {
        var FilterClass = AdvancedSearchFilters.oFilters[filterType],
            instance = Object.create(FilterClass.prototype);
        FilterClass.apply(instance, args);
        return instance;
    }

    /*
     * Helper to check equality for filter values
     */
    function hasValueSet(filter) {
        var unset = filter.unsetValue,
            val = filter.save();

        if (filter.hasValueSet !== undefined) {
            return filter.hasValueSet();
        }

        if (!Array.isArray(val)) { return true; }

        // ensure unset is an array
        if (!Array.isArray(unset)) { unset = [ unset ]; }

{'fraction_non_alphanumeric': 0.12331011880376895, 'fraction_numerical': 0.0, 'mean_word_length': 2.3360655737704916, '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': '2009484', 'n_tokens_mistral': 683, 'n_tokens_neox': 676, 'n_words': 165}