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AIxC,OAFA,EAAO,GAAQ,EAER,CACX,KAMhB,OAAO,QAAU,IAAI","file":"/npm/js-task-path@2.0.4/dist/js-task-path.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/js-task-path@2.0.4/dist/js-task-path.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\n/*\n |----------------------------------------------------------------------------------------------------------------------\n | A helper class to manage task-, build- and deployment-related paths more easily throughout the whole project.\n |----------------------------------------------------------------------------------------------------------------------\n */\n\n/**\n * More information on [JavaScript Open Standards]{@link https://github.com/jsopenstd/jsopenstd}.\n *\n * @namespace js.task.path\n * @version 2.0.4\n *\n * @author Richard King <richrdkng@gmail.com> [GitHub]{@link https://github.com/richrdkng}\n * @license [MIT]{@link https://github.com/jsopenstd/js-partial-foreach/blob/master/license.md}\n */\n\n/*\n |----------------------------------------------------------------------------------------------------------------------\n | Essential Modules\n |----------------------------------------------------------------------------------------------------------------------\n */\nconst nodePath           = require('path'),\n      appRootPath        = require('app-root-path'),\n      escapeStringRegexp = require('escape-string-regexp'),\n      extend             = require('extend'),\n      foreach            = require('js-partial-foreach'),\n      isPresent          = require('js-partial-is-present'),\n      isString           = require('js-partial-is-string'),\n      isEmptyString      = require('js-partial-is-empty-string'),\n      isArray            = require('js-partial-is-array'),\n      isObject           = require('js-partial-is-object'),\n      arrayMerge         = require('js-partial-array-merge');\n/*\n |----------------------------------------------------------------------------------------------------------------------\n | Exceptions\n |----------------------------------------------------------------------------------------------------------------------\n */\nconst InvalidGlobException     = require('./exception/InvalidGlobException'),\n      InvalidPathNameException = require('./exception/InvalidPathNameException'),\n      PathNotFoundException    = require('./exception/PathNotFoundException'),\n      TypeException            = require('./exception/TypeException');\n\n/*\n |----------------------------------------------------------------------------------------------------------------------\n | 'self' for the module's class (Path)\n |\n | use a shorthand, a fairly known convention named 'self'\n | to represent 'static' properties and methods of the module's class (Path) in a short form\n |----------------------------------------------------------------------------------------------------------------------\n */\nconst self = (() => {\n    return extend(\n\n        /*\n         |--------------------------------------------------------------------------------------------------------------\n         | Constructor\n         |--------------------------------------------------------------------------------------------------------------\n         */\n\n        /**\n         * The helper class to manage **task-**, **build-** and **deployment-related** paths more easily throughout\n         * the whole project.\n         *\n         * @class Path\n         * @memberOf js.task.path\n         */\n        function Path() {\n            // create a placeholder function as a base function for further extension\n\n            /**\n             * A getter/setter shorthand for path.\n             *\n             * @public\n             * @instance\n             * @function ()\n             * @memberOf js.task.path.Path\n             *\n             * @param {string|{}}       name   - The name of the glob.\n             *                                   If it is an object, multiple path globs can be set at once.\n             * @param {string|string[]} [glob] - The glob of path.\n             *\n             * @returns {string|string[]|Path} If used as a getter, returns glob of path.\n             *                                 If used a setter, returns Path to provide chainability.\n             */\n            const instance = function PathInstance(name, glob) {\n\n                // if glob is present, behave as a setter\n                if (isPresent(glob)) {\n                    return PathInstance.set(name, glob);\n                }\n\n                // if name is an array, behave as setter for multiple paths\n                if (isObject(name)) {\n                    foreach(\n                        name,\n                        (pathName, pathGlob) => {\n                            PathInstance.set(pathName, pathGlob);\n                        }\n                    );\n\n                    return PathInstance;\n                }\n\n                // behave as a getter\n                return PathInstance.get(name);\n            };\n\n            /*\n             |----------------------------------------------------------------------------------------------------------\n             | Extension and Instantiations\n             |----------------------------------------------------------------------------------------------------------\n             */\n\n            // extend the placeholder function with Path's prototype\n            // as the placeholder function will behave as an instance of Path and '.this' will be properly usable,\n            // but at the same time it will be still just a function and it can be just simply called\n            // providing a shorthand getter/setter functionality for the path globs (e.g.: path('<root>'))\n            extend(\n                instance,\n                Path.prototype,\n                self\n            );\n\n            // resets the path to default values.\n            instance.reset();\n\n            // return the placeholder function with all the necessary functionality from Path's prototype\n            // and with initial, instantiated values\n            return instance;\n        },\n\n        /*\n         |--------------------------------------------------------------------------------------------------------------\n         | Constants\n         |--------------------------------------------------------------------------------------------------------------\n         */\n        (() => {\n            const constant = {};\n\n            /**\n             * The default name for root path.\n             *\n             * @public\n             * @static\n             * @const {string} DEFAULT_ROOT_NAME\n             * @default root\n             *\n             * @memberOf js.task.path.Path\n             */\n            constant.DEFAULT_ROOT_NAME = 'root';\n\n            /**\n             * The default name tokens.\n             *\n             * @public\n             * @static\n             * @const {string[]} DEFAULT_TOKENS\n             *\n             * @memberOf js.task.path.Path\n             */\n            constant.DEFAULT_TOKENS = [\n                '<',  '>',\n                '<<', '>>',\n\n                '@',  '@',\n                '{@', '@}',\n\n                '{%', '%}',\n                '{{', '}}',\n            ];\n\n            /**\n             * The default value for creating a path, when doesn't exist.\n             *\n             * @public\n             * @static\n             * @const {number} CREATE_IF_PATH_NOT_EXISTS\n             *\n             * @memberOf js.task.path.Path\n             */\n            constant.CREATE_IF_PATH_NOT_EXISTS = 1;\n\n            /**\n             * The default value for throwing an exception, when path doesn't exist.\n             *\n             * @public\n             * @static\n             * @const {number} THROW_IF_PATH_NOT_EXISTS\n             *\n             * @memberOf js.task.path.Path\n             */\n            constant.THROW_IF_PATH_NOT_EXISTS = 2;\n\n            /**\n             * The default value for non-existent appendTo() path behaviour.\n             *\n             * @public\n             * @static\n             * @const {number} DEFAULT_APPEND\n             *\n             * @memberOf js.task.path.Path\n             */\n            constant.DEFAULT_APPEND = constant.CREATE_IF_PATH_NOT_EXISTS;\n\n            /**\n             * The default values for Path.\n             *\n             * @public\n             * @static\n             * @const {{}} DEFAULTS\n             *\n             * @memberOf js.task.path.Path\n             */\n            constant.DEFAULTS = {\n                rootName : constant.DEFAULT_ROOT_NAME,\n                tokens   : constant.DEFAULT_TOKENS,\n                append   : constant.DEFAULT_APPEND,\n            };\n\n            return constant;\n        })(),\n\n        /*\n         |--------------------------------------------------------------------------------------------------------------\n         | Instance Functions\n         |--------------------------------------------------------------------------------------------------------------\n         */\n        {\n            prototype : {\n                /*\n                 |------------------------------------------------------------------------------------------------------\n                 | Public Functions\n                 |------------------------------------------------------------------------------------------------------\n                 */\n\n                /**\n                 * Gets the glob path by the given name.\n                 *\n                 * @public\n                 * @instance\n                 * @function get\n                 * @memberOf js.task.path.Path\n                 *\n                 * @param {string} name - The name of the glob path.\n                 *                        If the name contains an existing\n                 *                        path name (e.g.: path.get('<root>/package.json')), then it will be\n                 *                        automatically resolved.\n                 *\n                 * @returns {string|string[]} The glob path.\n                 *\n                 * @example\n                 * // auto-resolve a path, so\n                 * // instead of this below:\n                 * path.get('root') + '/package.json';\n                 *\n                 * // it can be used like this:\n                 * path.get('<root>/package.json');\n                 */\n                get(name) {\n                    // in case of root\n                    if (name === this._options.rootName) {\n                        return this.getRoot();\n                    }\n\n                    // in case of auto-resolvable path names\n                    if (this._containsToken(name)) {\n                        return this._resolveNameTokens(name);\n                    }\n\n                    this._checkPathExists(name);\n\n                    return this._paths[name];\n                },\n\n                /**\n                 * Sets the given glob path by the given name.\n                 *\n                 * If the glob path by the same name already exists, it will be overridden.\n                 *\n                 * @public\n                 * @instance\n                 * @function set\n                 * @memberOf js.task.path.Path\n                 *\n                 * @param {string}          name - The name of the glob path.\n                 * @param {string|string[]} glob - The glob path. Can be an array of globs.\n                 *\n                 * @returns {Path} The path instance to provide chainability.\n                 */\n                set(name, glob) {\n                    this._setGlobPath(this._paths, name, glob);\n\n                    return this;\n                },\n\n                /**\n                 * Returns whether a glob path by the given name was stored previously.\n                 *\n                 * @public\n                 * @instance\n                 * @function has\n                 * @memberOf js.task.path.Path\n                 *\n                 * @param {string} name - The name of the glob path.\n                 *\n                 * @returns {boolean} Whether has a path under this name.\n                 */\n                has(name) {\n                    this._checkName(name);\n\n                    return name in this._paths;\n                },\n\n                /**\n                 * Returns whether a previously stored glob path by the given name contains the given glob path.\n                 *\n                 * If the previously stored glob path is the same (if it is a string) as -\n                 * or contains (if it is an array of glob paths) - the given glob path, it will return true.\n                 *\n                 * @public\n                 * @instance\n                 * @function contains\n                 * @memberOf js.task.path.Path\n                 *\n                 * @param {string}          name - The name of the glob path.\n                 * @param {string|string[]} glob - The glob path of multiple glob paths to check.\n\n                 * @returns {boolean} Whether the path with a name contains the glob.\n                 */\n                contains(name, glob) {\n                    this._checkName(name);\n                    this._checkGlob(glob);\n\n                    let filteredGlob,\n                        storedGlob;\n\n                    if (this.has(name)) {\n                        filteredGlob = this._filterGlob(glob);\n                        storedGlob   = this.get(name);\n\n                        if (isArray(storedGlob)) {\n                            if (isString(filteredGlob)) {\n                                filteredGlob = [filteredGlob];\n                            }\n\n                            let contains = true;\n\n                            filteredGlob.forEach(\n                                (value) => {\n                                    if (storedGlob.indexOf(value) === -1) {\n                                        contains = false;\n\n                                        return false;\n                                    }\n                                }\n                            );\n\n                            return contains;\n                        }\n\n                        return filteredGlob === storedGlob;\n                    }\n\n                    return false;\n                },\n\n                /**\n                 * Removes the glob path by the given name from the stored glob paths.\n                 *\n                 * @public\n                 * @instance\n                 * @function remove\n                 * @memberOf js.task.path.Path\n                 *\n                 * @param {string} name - The name of the glob path.\n                 *\n                 * @returns {void}\n                 */\n                remove(name) {\n                    this._checkName(name);\n\n                    if (this.has(name)) {\n                        delete this._paths[name];\n                    }\n                },\n\n                /**\n                 * Appends the given glob path to the given name.\n                 *\n                 * If there is no stored glob path under the given name,\n                 * it will be added anyway, as just as it was added via set(...).\n                 *\n                 * @public\n                 * @instance\n                 * @function appendTo\n                 * @memberOf js.task.path.Path\n                 *\n                 * @param {string}          name - The name of the glob path.\n                 * @param {string|string[]} glob - The glob path. Can be an array of globs.\n                 *\n                 * @returns {Path} The path instance to provide chainability.\n                 */\n                appendTo(name, glob) {\n                    this._checkName(name);\n                    this._checkGlob(glob);\n\n                    let filteredGlob;\n\n                    if ( ! this.has(name)) {\n                        switch (this._options.append) {\n                            case self.CREATE_IF_PATH_NOT_EXISTS:\n                                this.set(name, glob);\n                                break;\n\n                            case self.THROW_IF_PATH_NOT_EXISTS:\n                                throw new PathNotFoundException(name, glob);\n\n                            // skip default case, it's not needed\n                        }\n\n                    } else {\n                        // only append to the given name, if the stored glob\n                        // isn't equal to/doesn't contain the given glob\n                        if ( ! this.contains(name, glob)) {\n                            let storedGlob = this.get(name);\n\n                            // if the stored glob isn't an array, convert it\n                            if (isString(storedGlob) ) {\n                                storedGlob = [storedGlob];\n                            }\n\n                            filteredGlob = this._processGlob(glob);\n\n                            // if the processed glob isn't an array, convert it\n                            if (isString(filteredGlob)) {\n                                filteredGlob = [filteredGlob];\n                            }\n\n                            filteredGlob = arrayMerge(storedGlob, filteredGlob);\n\n                            this._paths[name] = filteredGlob;\n                        }\n                    }\n\n                    return this;\n                },\n\n                /**\n                 * Removes the given glob path by the given name.\n                 *\n                 * After the successful removal of the given glob path,\n                 * if the given name will be empty (as the last glob path was removed),\n                 * it will be removed from the stored named glob paths.\n                 *\n                 * @public\n                 * @instance\n                 * @function removeFrom\n                 * @memberOf js.task.path.Path\n                 *\n                 * @param {string}          name - The name of the glob path.\n                 * @param {string|string[]} glob - The glob path. Can be an array of globs.\n                 *\n                 * @returns {void}\n                 */\n                removeFrom(name, glob) {\n                    this._checkName(name);\n                    this._checkGlob(glob);\n\n                    if (this.has(name) && this.contains(name, glob)) {\n                        let processedGlob = this._processGlob(glob),\n                            storedGlob    = this.get(name);\n\n                        // if globs are string and they are the same (the glob to be removed is the only one)\n                        // delete the glob path, since empty glob paths are not allowed\n                        if (isString(processedGlob) &&\n                            isString(storedGlob) &&\n                            processedGlob === storedGlob) {\n\n                            this.remove(name);\n\n                        } else {\n                            if (isString(processedGlob)) {\n                                processedGlob = [processedGlob];\n                            }\n\n                            if (isString(storedGlob)) {\n                                storedGlob = [storedGlob];\n                            }\n\n                            processedGlob.forEach(\n                                (processedGlobEntry) => {\n                                    const index = storedGlob.indexOf(processedGlobEntry);\n\n                                    storedGlob.splice(index, 1);\n                                }\n                            );\n\n                            if (storedGlob.length === 0) {\n                                this.remove(name);\n                            }\n                        }\n                    }\n                },\n\n                /**\n                 * Returns all of the stored named glob paths.\n                 *\n                 * The returned object will be a deep copy of the original object,\n                 * modifying the returned object will not change the original object.\n                 *\n                 * @public\n                 * @instance\n                 * @function getAll\n                 * @memberOf js.task.path.Path\n                 *\n                 * @returns {{}} The object containing all of the named glob paths.\n                 */\n                getAll() {\n                    return extend(true, {}, this._paths);\n                },\n\n                /**\n                 * Removes all the stored named glob paths.\n                 *\n                 * @public\n                 * @instance\n                 * @function removeAll\n                 * @memberOf js.task.path.Path\n                 *\n                 * @returns {void}\n                 */\n                removeAll() {\n                    this._paths = {};\n                },\n\n                /**\n                 * Resets the path with default options.\n                 * Also deletes every previously set path globs and sets the root back to the original path.\n                 *\n                 * @public\n                 * @instance\n                 * @function reset\n                 * @memberOf js.task.path.Path\n                 *\n                 * @returns {void}\n                 */\n                reset() {\n                    /**\n                     * The storage object for the named glob paths.\n                     *\n                     * @private {{}}\n                     * @default {}\n                     */\n                    this._paths = {};\n\n                    /**\n                     * The storage object for options\n                     *\n                     * @private {{}}\n                     * @default {}\n                     */\n                    this._options = {};\n\n                    this.removeAll();\n                    this.setOptions(self.DEFAULTS);\n                    this.setRoot(appRootPath.toString());\n                },\n\n                /**\n                 * Returns the options of path.\n                 *\n                 * @public\n                 * @instance\n                 * @function getOptions\n                 * @memberOf js.task.path.Path\n                 *\n                 * @param {string} [specificOption] - If specified, the specific option\n                 *                                    with that name will be returned.\n                 *\n                 * @returns {{}|*} The storage object, that holds the values of the options.\n                 *                 If a specific option was specified, return that specific option.\n                 *\n                 */\n                getOptions(specificOption) {\n                    const clonedOptions = extend(true, {}, this._options);\n\n                    if (isString(specificOption) && ! isEmptyString(specificOption)) {\n                        return clonedOptions[specificOption];\n                    }\n\n                    return clonedOptions;\n                },\n\n                /**\n                 * Sets the options for paths.\n                 *\n                 * @public\n                 * @instance\n                 * @function setOptions\n                 * @memberOf js.task.path.Path\n                 *\n                 * @param {{}} options - The storage object, which holds the values of the options to change.\n                 *\n                 * @returns {void}\n                 */\n                setOptions(options) {\n                    this._checkOptions(options);\n\n                    extend(this._options, options);\n\n                    // if tokens were changed, regenerate the RegExp patterns;\n                    if (options.tokens) {\n                        /**\n                         * The RegExp patterns for matching name tokens.\n                         *\n                         * @private {RegExp[]}\n                         */\n                        this._tokens = [];\n\n                        let prefix,\n                            suffix;\n\n                        foreach(\n                            options.tokens,\n                            (index, token) => {\n                                token = escapeStringRegexp(token);\n\n                                if (index % 2 === 0) {\n                                    prefix = token;\n                                } else {\n                                    suffix = token;\n                                }\n\n                                // construct a new RegExp pattern from the actual prefix and suffix, then prepare them\n                                // for the next token iteration by resetting them (prefix = suffix = null)\n                                if (prefix && suffix) {\n                                    this._tokens.unshift(\n                                        new RegExp(`\\\\s*${prefix}([\\\\s\\\\-\\\\\\\\\\\\/.*\\\\w]+)${suffix}\\\\s*`, 'i')\n                                    );\n                                    prefix = suffix = null;\n                                }\n                            }\n                        );\n                    }\n\n                    // sort RegExp patterns to check longer tokens first and shortest last\n                    // to ensure proper token resolution\n                    this._tokens = this._tokens.sort().reverse();\n                },\n\n                /**\n                 * Returns the root glob path.\n                 *\n                 * The root glob path is determined at the instantiation of the Path class.\n                 * Be cautious regarding the value of this root glob path,\n                 * after the original root glob path is changed.\n                 *\n                 * @public\n                 * @instance\n                 * @function getRoot\n                 * @memberOf js.task.path.Path\n                 *\n                 * @returns {string} The root glob path.\n                 */\n                getRoot() {\n                    return this[`_${this._options.rootName}`];\n                },\n\n                /**\n                 * Sets the root glob path by the given glob path.\n                 *\n                 * As the root glob path is determined at the instantiation of the Path class,\n                 * be cautious, when changing the root glob path to avoid unwanted errors.\n                 *\n                 * @public\n                 * @instance\n                 * @function setRoot\n                 * @memberOf js.task.path.Path\n                 *\n                 * @param {string} glob - The root glob path.\n                 *\n                 * @returns {void}\n                 */\n                setRoot(glob) {\n                    this._setGlobPath(this, `_${this._options.rootName}`, glob);\n                },\n\n                /*\n                 |------------------------------------------------------------------------------------------------------\n                 | Private Functions\n                 |------------------------------------------------------------------------------------------------------\n                 */\n\n                /**\n                 * Check whether the name is valid.\n                 *\n                 * @private\n                 * @instance\n                 * @function _checkName\n                 *\n                 * @param {string} name - The name of a path entry.\n                 *\n                 * @returns {void}\n                 */\n                _checkName(name) {\n                    if ( ! isString(name) || isEmptyString(name)) {\n                        throw new InvalidPathNameException(name);\n                    }\n                },\n\n                /**\n                 * Check whether the glob is valid.\n                 *\n                 * @private\n                 * @instance\n                 * @function _checkGlob\n                 *\n                 * @param {string} glob - The glob of a path.\n                 *\n                 * @returns {void}\n                 */\n                _checkGlob(glob) {\n                    if ( ! isString(glob) && ! isArray(glob)) {\n                        throw new InvalidGlobException(glob);\n                    }\n                },\n\n                /**\n                 * Check whether the options object is valid.\n                 *\n                 * @private\n                 * @instance\n                 * @function _checkOptions\n                 *\n                 * @param {string} options - The options object.\n                 *\n                 * @returns {void}\n                 */\n                _checkOptions(options) {\n                    if ( isPresent(options) && ! isObject(options)) {\n                        throw new TypeException(options);\n                    }\n                },\n\n                /**\n                 * Check whether the the path entry under name exists.\n                 *\n                 * @private\n                 * @instance\n                 * @function _checkPathExists\n                 *\n                 * @param {string} name   - The name of the path entry.\n                 * @param {string} [glob] - The glob of the path.\n                 *\n                 * @returns {void}\n                 */\n                _checkPathExists(name, glob) {\n                    if (name === this._options.rootName) {\n                        return;\n                    }\n\n                    if ( ! this.has(name) ) {\n                        throw new PathNotFoundException(name, glob);\n                    }\n                },\n\n                /**\n                 * Returns the index for an existing token if an existing token pattern can be found in the string.\n                 *\n                 * @private\n                 * @instance\n                 * @function _getTokenIndexFor\n                 *\n                 * @param {string} string - The string to check.\n                 *\n                 * @returns {number} If the string contains an index for an existing token, returns its index.\n                 *                   Otherwise returns -1;\n                 */\n                _getTokenIndexFor(string) {\n                    let tokenIndex = -1;\n\n                    if (isString(string) && ! isEmptyString(string)) {\n                        foreach(\n                            this._tokens,\n                            /**\n                             * @param {number} index - The index of the token.\n                             * @param {RegExp} token - The token compiled to RegExp.\n                             */\n                            (index, token) => {\n                                if (token.test(string)) {\n                                    tokenIndex = index;\n\n                                    return false;\n                                }\n                            }\n                        );\n                    }\n\n                    return tokenIndex;\n                },\n\n                /**\n                 * Determines whether the string contains tokens.\n                 *\n                 * @private\n                 * @instance\n                 * @function _containsToken\n                 *\n                 * @param {string} string - The string to check.\n                 *\n                 * @returns {boolean} If the string contains token, returns true.\n                 */\n                _containsToken(string) {\n                    return this._getTokenIndexFor(string) > -1;\n                },\n\n                /**\n                 * Resolves the path by name-tokens.\n                 *\n                 * @private\n                 * @instance\n                 * @function _resolveNameTokens\n                 *\n                 * @param {string|string[]} glob - The glob path. A name-token could be e.g.: <root>\n                 *                                 If the resolved name-token is an array containing multiple paths,\n                 *                                 only the 1st of those paths will be used -- for more information\n                 *                                 check the source.\n                 *\n                 * @returns {string|string[]} The resolved glob path.\n                 */\n                _resolveNameTokens(glob) {\n                    let globs = glob;\n\n                    if (isString(glob)) {\n                        globs = [glob];\n                    }\n\n                    globs.forEach(\n                        (value, index, array) => {\n                            const globValue  = value,\n                                  tokenIndex = this._getTokenIndexFor(globValue);\n\n                            array[index] = globValue.replace(this._tokens[tokenIndex], (match, name) => {\n                                this._checkPathExists(name, globValue);\n\n                                let path = this.get(name);\n\n                                // if the path consists of multiple globs in an array,\n                                // only the 1st glob in the array will be used\n                                if (isArray(path)) {\n                                    path = path[0];\n                                }\n\n                                return path;\n                            });\n                        }\n                    );\n\n                    // if it contains only one glob, then return just that one\n                    // and the return value will be a string\n                    if (globs.length === 1) {\n                        return globs[0];\n                    }\n\n                    // be default, the return value will be a string[]\n                    return globs;\n                },\n\n                /**\n                 * Filters the given glob path by the passed options.\n                 *\n                 * @private\n                 * @instance\n                 * @function _filterGlob\n                 *\n                 * @param {string|string[]} glob - The glob path or multiple glob paths.\n                 *\n                 * @returns {string|string[]} The filtered glob path.\n                 */\n                _filterGlob(glob) {\n                    this._checkGlob(glob);\n\n                    let filteredGlob = this._resolveNameTokens(glob);\n\n                    if (isString(filteredGlob)) {\n                        filteredGlob = [filteredGlob];\n                    }\n\n                    filteredGlob.forEach(\n                        (value, index, array) => {\n                            array[index] = nodePath.normalize(value);\n                        }\n                    );\n\n                    // if it contains only one glob, then return just that one\n                    // and the return value will be a string\n                    if (filteredGlob.length === 1) {\n                        return filteredGlob[0];\n                    }\n\n                    // be default, the return value will be a string[]\n                    return filteredGlob;\n                },\n\n                /**\n                 * Processes the given glob path by the given options.\n                 *\n                 * @private\n                 * @instance\n                 * @function _processGlob\n                 *\n                 * @param {string|string[]} glob - The glob path.\n                 *\n                 * @returns {string|string[]} The filtered glob path.\n                 */\n                _processGlob(glob) {\n                    let filteredGlob;\n\n                    if (isArray(glob)) {\n                        filteredGlob = [];\n\n                        glob.forEach(\n                            (entry) => {\n                                filteredGlob.push(this._filterGlob(entry));\n                            }\n                        );\n\n                    } else {\n                        filteredGlob = this._filterGlob(glob);\n                    }\n\n                    return filteredGlob;\n                },\n\n                /**\n                 * Sets glob path in the given object.\n                 *\n                 * @private\n                 * @instance\n                 * @function _setGlobPath\n                 *\n                 * @param {{}}              object - The object in which the glob path will be set.\n                 * @param {string}          name   - The name of the glob.\n                 * @param {string|string[]} glob   - The blog path.\n                 *\n                 * @returns {string|string[]} The glob, that was set in the given object.\n                 */\n                _setGlobPath(object, name, glob) {\n                    this._checkName(name);\n                    this._checkGlob(glob);\n\n                    const processedGlob = this._processGlob(glob);\n\n                    object[name] = processedGlob;\n\n                    return processedGlob;\n                },\n            },\n        }\n    );\n})();\n\nmodule.exports = new self();\n"]}