New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

revolt.js

Package Overview
Dependencies
Maintainers
1
Versions
271
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

revolt.js - npm Package Compare versions

Comparing version 5.2.7 to 5.2.8

48

dist/maps/Servers.js

@@ -263,33 +263,35 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

// 7ms to sort both lists.
data.users.sort((a, b) => b._id.localeCompare(a._id));
data.members.sort((a, b) => b._id.user.localeCompare(a._id.user));
// data.users.sort((a,b)=>b._id.localeCompare(a._id));
// data.members.sort((a,b)=>b._id.user.localeCompare(a._id.user));
// This takes roughly 23ms.
runInAction(() => {
// This adds roughly 15ms to 23ms above.
const mapping = {};
data.members.forEach(x => mapping[x._id.user] = x);
for (let i = 0; i < data.users.length; i++) {
if (data.users[i].online) {
const user = data.users[i];
this.client.users.createObj(user);
this.client.members.createObj(mapping[user._id]);
}
}
});
if (skipOffline)
return;
let j = 0;
// Each batch takes between 70 and 90ms.
const batch = () => {
const offset = j * 100;
runInAction(() => {
for (let i = offset; i < data.users.length && i < offset + 100; i++) {
this.client.users.createObj(data.users[i]);
this.client.members.createObj(data.members[i]);
}
});
if (offset < data.users.length) {
j++;
setTimeout(batch, 0);
}
if (skipOffline)
return;
let j = 0;
// Each batch takes between 70 and 90ms.
const batch = () => {
const offset = j * 100;
runInAction(() => {
for (let i = offset; i < data.users.length && i < offset + 100; i++) {
if (!data.users[i].online) {
this.client.users.createObj(data.users[i]);
this.client.members.createObj(data.members[i]);
}
}
});
if (offset < data.users.length) {
j++;
setTimeout(batch, 0);
}
};
setTimeout(batch, 0);
});
};
setTimeout(batch, 0);
});

@@ -296,0 +298,0 @@ }

{
"type": "module",
"name": "revolt.js",
"version": "5.2.7",
"version": "5.2.8",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "repository": "https://github.com/revoltchat/revolt.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc