lint: sync Apps.js with linter rules

This is comitted separately because it should not have any functional
changes. Do not skip this in a `git bisect`, but do not revert this when
testing commits for functional changes.
This commit is contained in:
KernelDeimos
2025-12-22 12:50:45 -05:00
committed by Eric Dubé
parent dc5f61b438
commit 7786deefb7
+8 -8
View File
@@ -16,31 +16,31 @@ class Apps {
this.appID = puter.appID;
}
#addUserIterationToApp(app) {
#addUserIterationToApp (app) {
app.getUsers = async (params) => {
params = params ?? {};
return (await puter.drivers.call('app-telemetry', 'app-telemetry', 'get_users', { app_uuid: app.uid, limit: params.limit, offset: params.offset })).result;
}
};
app.users = async function* (pageSize = 100) {
let offset = 0;
while (true) {
while ( true ) {
const users = await app.getUsers({ limit: pageSize, offset });
if (!users || users.length === 0) return;
if ( !users || users.length === 0 ) return;
for (const user of users) {
for ( const user of users ) {
yield user;
}
offset += users.length;
if (users.length < pageSize) return;
if ( users.length < pageSize ) return;
}
}
};
return app;
}
#addUserIterationToApps(apps) {
#addUserIterationToApps (apps) {
apps.forEach(app => {
this.#addUserIterationToApp(app);
});