<commit_before>var linz = require('../'),
    async = require('async');

module.exports = function () {

    if (!arguments.length) {
        throw new Error('Exclusions middleware is missing parameters. Please provide at least one middleware function.');
    }

    var args = Array.prototype.slice.call(arguments),
        exclusions = [new RegExp("^" + "/admin".replace(/\//g, '\/') + "\/(login|public)")], // TODO: change /admin to linz.get('admin path')
        middlewares = args;

    if (Array.isArray(args[0]) && args.length === 1) {
        throw new Error('Please provide the middleware as the second parameter if the first is an exclusion Array.');
    }

    if (Array.isArray(args[0])) {
        exclusions = args[0];
        // remove the first arguments as this is an exclusion
        middlewares.splice(0,1);
    }

    return function (req, res, next) {

        // should we exclude this url?
        var exclude = exclusions.some(function (exclusion) {
            return exclusion.test(req.originalUrl);
        });<commit_msg>Linz by default will now exclude authentication checks and navigation middleware on logout route.<commit_after>var linz = require('../'),
    async = require('async');

module.exports = function () {

    if (!arguments.length) {
        throw new Error('Exclusions middleware is missing parameters. Please provide at least one middleware function.');
    }

    var args = Array.prototype.slice.call(arguments),
        exclusions = [new RegExp("^" + "/admin".replace(/\//g, '\/') + "\/(login|logout|public)")], // TODO: change /admin to linz.get('admin path')
        middlewares = args;

    if (Array.isArray(args[0]) && args.length === 1) {
        throw new Error('Please provide the middleware as the second parameter if the first is an exclusion Array.');
    }

    if (Array.isArray(args[0])) {
        exclusions = args[0];
        // remove the first arguments as this is an exclusion
        middlewares.splice(0,1);
    }

    return function (req, res, next) {

        // should we exclude this url?
        var exclude = exclusions.some(function (exclusion) {
            return exclusion.test(req.originalUrl);
        });
{'fraction_non_alphanumeric': 0.13796253997259023, 'fraction_numerical': 0.00548195523069895, 'mean_word_length': 2.7181663837011882, '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': '5914285', 'n_tokens_mistral': 618, 'n_tokens_neox': 603, 'n_words': 193}