Files
discord-decomp/_bundle/iterateIterator.js
T
2026-11-01 12:12:55 +02:00

39 lines
899 B
JavaScript

// Metro module 4437 (f4438).
const TypeError2 = TypeError;
module.exports = function iterateIterator(a0) {
let done;
if (a0 && typeof a0.next === "function") {
const r2 = arguments.length > 1;
let r15 = void 0;
if (r2) {
r15 = arguments[1];
if (typeof r15 !== "function") {
throw new TypeError2("`callback`, if provided, must be a function");
}
}
const r16 = r15 || [];
let r7 = a0.next();
if (r7 && !r7.done) {
do {
const r18 = r7;
if (r15) {
r15(r18.value);
} else {
r16.push(r18.value);
}
const r23 = a0.next();
if (!r23) {
break;
}
done = r23.done;
r7 = r23;
} while (!done);
}
if (r15) {
return void 0;
}
return r16;
}
throw new TypeError2("iterator must be an object with a `next` method");
};