403Webshell
Server IP : 185.208.173.17  /  Your IP : 87.236.161.98
Web Server : Microsoft-IIS/10.0
System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64
User : IUSR ( 0)
PHP Version : 7.4.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/parsmega.nuxt/node_modules/memcache-plus/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/parsmega.nuxt/node_modules/memcache-plus/lib/misc.js
/**
 * @file misc.js
 *
 * Miscellaneous utility methods
 */

var Promise = require('bluebird'),
    zlib = Promise.promisifyAll(require('zlib'));

function assert(cond, msg) {
    if(!cond) { throw new Error('AssertionError: ' + msg); }
}
exports.assert = assert;

exports.defer = function defer(key) {
    key = key || null;

    var resolve, reject;
    var promise = new Promise(function() {
        resolve = arguments[0];
        reject = arguments[1];
    });
    return {
        key: key,
        resolve: resolve,
        reject: reject,
        promise: promise
    };
};

/**
 * compress() - Compress the supplied value
 *
 * @param {Buffer} val - the buffer to compress
 * @returns {Promise} - Promise for the compressed buffer
 */
exports.compress = function compress(val) {
    assert(val instanceof Buffer, 'Memcache-Plus can only compress a Buffer');
    return zlib.deflateAsync(val);
};

/**
 * decompress() - Decompress the supplied value
 *
 * @param {Buffer} val - the buffer to decompress
 * @returns {Promise} - Promise for the decompressed buffer
 */
exports.decompress = function decompress(val) {
    assert(val instanceof Buffer, 'Memcache-Plus can only decompress a Buffer');
    return zlib.inflateAsync(val);
};

/**
 * truncateIfNecessary() - Truncate string if too long, for display purposes
 *   only
 */
exports.truncateIfNecessary = function truncateIfNecessary(str, len) {
    assert(typeof str === 'string', 'str needs to be of type "string"');
    len = len || 100;
    return str && str.length > len ? str.substr(0, len) + '...' : str;
};

Youez - 2016 - github.com/yon3zu
LinuXploit