70 lines
2.9 KiB
TypeScript
70 lines
2.9 KiB
TypeScript
/* Metro module 4890; source: modules/app_database/util/Lru.tsx; dependencies: [6, 7, 2] */
|
|
function _fun43050(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#43050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5068:6, offset: 0x011490e3, size: 124 bytes, params: 8, frame: 18
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_0 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_1 = importDefault(7) /* metro dependency 7 */;
|
|
const value = _fun43051();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_database/util/Lru.tsx');
|
|
exports.Lru = value;
|
|
}
|
|
|
|
function _fun43051() { // fn#43051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5068:118, offset: 0x0114915f, size: 343 bytes, params: 1, frame: 15
|
|
const binding = env0_1;
|
|
const closure = Lru;
|
|
const Symbol = global.Symbol;
|
|
return binding(closure, [{key: 'length', get: function() {
|
|
return this.items.size;
|
|
}}, {key: 'capacity', get: function() {
|
|
return this.limit;
|
|
}}, {key: Symbol.iterator, value: function() {
|
|
return this.items.entries();
|
|
}}, {key: 'entries', value: function() {
|
|
return this.items.entries();
|
|
}}, {key: 'keys', value: function() {
|
|
return this.items.keys();
|
|
}}, {key: 'values', value: function() {
|
|
return this.items.values();
|
|
}}, {key: 'ordered', value: function() {
|
|
var r2;
|
|
var value = this.items.values();
|
|
var items2 = [];
|
|
arraySpread(items2, value, 0, r2);
|
|
return items2.reverse();
|
|
}}, {key: 'clear', value: function() {
|
|
this.items.clear();
|
|
}}, {key: 'has', value: function(a0) {
|
|
return this.items.has(a0);
|
|
}}, {key: 'get', value: function(a0) {
|
|
return this.items.get(a0);
|
|
}}, {key: 'put', value: function(a0, a1) {
|
|
var value;
|
|
var value2;
|
|
var property = this.items;
|
|
property.delete(a0);
|
|
this.items.set(a0, a1);
|
|
property = this.items.size;
|
|
if (property > this.limit) {
|
|
value = this.oldestKey();
|
|
property = this.items;
|
|
value2 = property.get(value);
|
|
property = this.items;
|
|
property.delete(value);
|
|
return [value, value2];
|
|
}
|
|
}}, {key: 'delete', value: function(a0) {
|
|
return this.items.delete(a0);
|
|
}}, {key: 'oldestKey', value: function() {
|
|
return this.items.keys().next().value;
|
|
}}]);
|
|
}
|
|
|
|
function Lru(a0) { // fn#43052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5068:139, offset: 0x011492b6, size: 70 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
env1_0(this, Lru);
|
|
const Map = global.Map;
|
|
this.items = new Map();
|
|
this.limit = a0;
|
|
}
|
|
|