Files
discord-decomp/sources/lib/rateLimit.tsx
T
2026-07-28 01:06:53 +03:00

77 lines
3.3 KiB
TypeScript

/* Metro module 12529; source: lib/rateLimit.tsx; dependencies: [2] */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun95464(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#95464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12719:6, offset: 0x02146ec3, size: 87 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('lib/rateLimit.tsx');
exports.default = function(a0, a1, a2) {
var env0_0 = a0;
var env0_1 = a1;
var env0_2 = a2;
var env0_4 = [];
var closure = _fun95466;
var env0_5 = closure;
return closure;
};
function rateLimit(a0, a1, a2) { // fn#95465, offset: 0x02146f1a, size: 44 bytes, params: 4, frame: 2
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_4 = [];
return rateLimitWrapper;
function rateLimitWrapper(a0) { // fn#95466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12719:198, owner: rateLimit.wrapper, offset: 0x02146f46, size: 239 bytes, params: 2, frame: 20
var r9;
var clearTimeout;
var binding;
var items2;
const value = copyRestArgs(0, undefined);
const env0_0 = value;
const Date = global.Date;
const value2 = Date.now();
if (env0_3 != null) {
clearTimeout = global.clearTimeout;
clearTimeout(env0_3);
r9 = clearTimeout;
}
let length = env0_4.length;
if (length > 0) {
if (env0_4[0] <= value2) {
while (true) {
binding = env0_4;
binding.shift();
length = binding.length;
if (!(length > 0)) {
break;
}
if (env0_4[0] <= value2) {
continue;
}
break;
}
}
}
if (env0_4.length < env0_0) {
env0_4.push(value2 + require);
items2 = [];
arraySpread(items2, value, 0, r9);
apply(importDefault, items2, undefined, r9);
} else {
env0_3 = global.setTimeout(_fun95467, env0_4[0] - value2);
}
function _fun95467() { // fn#95467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12719:340, offset: 0x02147035, size: 41 bytes, params: 1, frame: 14
const rateLimitWrapperBinding = rateLimitWrapper;
const binding = env0_0;
const items2 = [];
arraySpread(items2, binding, 0, undefined);
return apply(rateLimitWrapperBinding, items2, undefined, undefined);
}
}
}
}
global.__d(_fun95464, 12529, [2]) /* metro module 12529, dependencies: [2] */;