HEX
Server: Apache/2.4.61 (Ubuntu)
System: Linux hosting106 7.0.12-1-pve #1 SMP PREEMPT_DYNAMIC PMX 7.0.12-1 (2026-06-09T21:07Z) x86_64
User: clinicadentalargarate.com (1193)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/cursos.ril.es/node_modules/laravel-elixir/node_modules/browser-sync/lib/hooks.js
"use strict";

var _            = require("../lodash.custom");
var Immutable    = require("immutable");
var snippetUtils = require("./snippet").utils;

module.exports = {

    /**
     *
     * @this {BrowserSync}
     * @returns {String}
     */
    "client:js": function (hooks, data) {

        var js  = snippetUtils.getClientJs(data.port, data.options);

        return hooks.reduce(function (joined, hook) {
            return joined + hook;
        }, js);
    },
    /**
     * @this {BrowserSync}
     * @returns {Array}
     */
    "client:events": function (hooks, clientEvents) {

        hooks.forEach(function (hook) {

            var result = hook(this);

            if (Array.isArray(result)) {
                clientEvents = _.union(clientEvents, result);
            } else {
                clientEvents.push(result);
            }
        }, this);

        return clientEvents;
    },
    /**
     * @returns {Array}
     */
    "server:middleware": function (hooks, initial) {

        initial = initial || [];

        _.each(hooks, function (hook) {

            var result = hook(this);

            if (Array.isArray(result)) {
                result.forEach(function (res) {
                    if (_.isFunction(res)) {
                        initial = initial.push(res);
                    }
                });

            } else {
                if (_.isFunction(result)) {
                    initial = initial.push(result);
                }
            }
        }, this);

        return initial;
    },
    /**
     * @param {Array} hooks
     * @param {Map|List} initial
     * @param pluginOptions
     * @returns {any}
     */
    "files:watch": function (hooks, initial, pluginOptions) {

        var opts;

        if (pluginOptions) {
            opts = Immutable.fromJS(pluginOptions);
            opts.forEach(function (value, key) {
                if (!value) {
                    return;
                }
                var files = value.get("files");
                if (files) {
                    var fileArg = require("./cli/cli-options").makeFilesArg(files);
                    if (fileArg) {
                        initial = initial.set(key, Immutable.fromJS(fileArg));
                    }
                }
            });
        }

        return initial;
    }
};