Files
notification-elements-demo/node_modules/thingies/lib/LruMap.js
Giuliano Silvestro 5d0c9ec7eb Initial commit: notification-elements-demo app
Interactive Angular 19 demo for @sda/notification-elements-ui with
6 sections: Bell & Feed, Notification Center, Inbox, Comments &
Threads, Mention Input, and Full-Featured layout. Includes mock
data, dark mode toggle, and real-time event log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:49:19 +10:00

31 lines
780 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LruMap = void 0;
class LruMap extends Map {
constructor(
// 2^30 - 1 (a SMI in V8, for 32-bit platforms)
limit = 1073741823) {
super();
this.limit = limit;
}
set(key, value) {
super.delete(key);
super.set(key, value);
if (super.size > this.limit)
super.delete(super.keys().next().value);
return this;
}
get(key) {
const value = super.get(key);
if (value === void 0) {
if (super.delete(key))
super.set(key, value);
return value;
}
super.delete(key);
super.set(key, value);
return value;
}
}
exports.LruMap = LruMap;