????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.148.211.202 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/appsrv.astacus.se/forge/node_modules/eslint/lib/config/ |
Upload File : |
/** * @fileoverview Responsible for caching config files * @author Sylvan Mably */ "use strict"; //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ /** * Get a string hash for a config vector * @param {Array<Object>} vector config vector to hash * @returns {string} hash of the vector values * @private */ function hash(vector) { return JSON.stringify(vector); } //------------------------------------------------------------------------------ // API //------------------------------------------------------------------------------ /** * Configuration caching class */ module.exports = class ConfigCache { constructor() { this.configFullNameCache = new Map(); this.localHierarchyCache = new Map(); this.mergedVectorCache = new Map(); this.mergedCache = new Map(); } /** * Gets a config object from the cache for the specified config file path. * @param {string} configFullName the name of the configuration as used in the eslint config(e.g. 'plugin:node/recommended'), * or the absolute path to a config file. This should uniquely identify a config. * @returns {Object|null} config object, if found in the cache, otherwise null * @private */ getConfig(configFullName) { return this.configFullNameCache.get(configFullName); } /** * Sets a config object in the cache for the specified config file path. * @param {string} configFullName the name of the configuration as used in the eslint config(e.g. 'plugin:node/recommended'), * or the absolute path to a config file. This should uniquely identify a config. * @param {Object} config the config object to add to the cache * @returns {void} * @private */ setConfig(configFullName, config) { this.configFullNameCache.set(configFullName, config); } /** * Gets a list of hierarchy-local config objects that apply to the specified directory. * @param {string} directory the path to the directory * @returns {Object[]|null} a list of config objects, if found in the cache, otherwise null * @private */ getHierarchyLocalConfigs(directory) { return this.localHierarchyCache.get(directory); } /** * For each of the supplied parent directories, sets the list of config objects for that directory to the * appropriate subset of the supplied parent config objects. * @param {string[]} parentDirectories a list of parent directories to add to the config cache * @param {Object[]} parentConfigs a list of config objects that apply to the lowest directory in parentDirectories * @returns {void} * @private */ setHierarchyLocalConfigs(parentDirectories, parentConfigs) { parentDirectories.forEach((localConfigDirectory, i) => { const directoryParentConfigs = parentConfigs.slice(0, parentConfigs.length - i); this.localHierarchyCache.set(localConfigDirectory, directoryParentConfigs); }); } /** * Gets a merged config object corresponding to the supplied vector. * @param {Array<Object>} vector the vector to find a merged config for * @returns {Object|null} a merged config object, if found in the cache, otherwise null * @private */ getMergedVectorConfig(vector) { return this.mergedVectorCache.get(hash(vector)); } /** * Sets a merged config object in the cache for the supplied vector. * @param {Array<Object>} vector the vector to save a merged config for * @param {Object} config the merged config object to add to the cache * @returns {void} * @private */ setMergedVectorConfig(vector, config) { this.mergedVectorCache.set(hash(vector), config); } /** * Gets a merged config object corresponding to the supplied vector, including configuration options from outside * the vector. * @param {Array<Object>} vector the vector to find a merged config for * @returns {Object|null} a merged config object, if found in the cache, otherwise null * @private */ getMergedConfig(vector) { return this.mergedCache.get(hash(vector)); } /** * Sets a merged config object in the cache for the supplied vector, including configuration options from outside * the vector. * @param {Array<Object>} vector the vector to save a merged config for * @param {Object} config the merged config object to add to the cache * @returns {void} * @private */ setMergedConfig(vector, config) { this.mergedCache.set(hash(vector), config); } };