mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 00:03:05 +00:00
ESLint: warn for deprecated constructs
This commit is contained in:
1 parent
11a0744edc
commit
3636d615db
5 files changed
+32
-10
No files matched your search
@@ -49,7 +49,11 @@ export function snowflakeBasedInvite() {
|
||||
snowflake = snowflake / base;
|
||||
}
|
||||
|
||||
return str.substr(3, 8).split("").reverse().join("");
|
||||
return str
|
||||
.slice(3, 3 + 8)
|
||||
.split("")
|
||||
.reverse()
|
||||
.join("");
|
||||
}
|
||||
|
||||
export function randomUpperString(length: number = 10) {
|
||||
|
||||
@@ -204,8 +204,8 @@ class UnixSocketListener {
|
||||
while (buffer.length >= 4) {
|
||||
const msgLen = buffer.readUInt32BE(0);
|
||||
if (buffer.length < 4 + msgLen) break;
|
||||
const msgBuf = buffer.slice(4, 4 + msgLen);
|
||||
buffer = buffer.slice(4 + msgLen);
|
||||
const msgBuf = buffer.subarray(4, 4 + msgLen);
|
||||
buffer = buffer.subarray(4 + msgLen);
|
||||
try {
|
||||
const payload = JSON.parse(msgBuf.toString());
|
||||
this.eventEmitter.emit(payload.id, payload.event);
|
||||
|
||||
Reference in new issue
Block a user