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/thingies/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/parsmega.nuxt/node_modules/thingies/lib/LruCache.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LruCache = void 0;
class LruCache {
    constructor(limit = 1000) {
        this.limit = limit;
        this.head = undefined;
        this.tail = undefined;
        this.map = Object.create(null);
        this.capacity = limit | 0;
    }
    get size() {
        return this.limit - this.capacity;
    }
    set(key, value) {
        const node = this.map[key];
        if (node) {
            this.pop(node);
            node.v = value;
            this.push(node);
        }
        else {
            if (!this.capacity) {
                const head = this.head;
                if (head) {
                    this.pop(head);
                    delete this.map[head.k];
                    this.capacity++;
                }
            }
            this.capacity--;
            const node = new LruNode(key, value);
            this.map[key] = node;
            this.push(node);
        }
    }
    get(key) {
        const node = this.map[key];
        if (!node)
            return;
        if (this.tail !== node) {
            this.pop(node);
            this.push(node);
        }
        return node.v;
    }
    peek(key) {
        const node = this.map[key];
        return node instanceof LruNode ? node.v : undefined;
    }
    has(key) {
        return key in this.map;
    }
    clear() {
        this.head = undefined;
        this.tail = undefined;
        this.map = Object.create(null);
        this.capacity = this.limit;
    }
    keys() {
        return Object.keys(this.map);
    }
    del(key) {
        const node = this.map[key];
        if (node instanceof LruNode) {
            this.pop(node);
            delete this.map[key];
            ++this.capacity;
            return true;
        }
        return false;
    }
    pop(node) {
        const l = node.l;
        const r = node.r;
        if (this.head === node)
            this.head = r;
        else
            l.r = r;
        if (this.tail === node)
            this.tail = l;
        else
            r.l = l;
        // node.l = undefined;
        // node.r = undefined;
    }
    push(node) {
        const tail = this.tail;
        if (tail) {
            tail.r = node;
            node.l = tail;
        }
        else
            this.head = node;
        this.tail = node;
    }
}
exports.LruCache = LruCache;
class LruNode {
    constructor(k, v) {
        this.k = k;
        this.v = v;
        this.l = undefined;
        this.r = undefined;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit